SQL要求对街道名称&中的家庭地址进行拆分住宅 # [英] SQL REquired splition in home address in street name & house #

查看:490
本文介绍了SQL要求对街道名称&中的家庭地址进行拆分住宅 #的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为家庭住址"的列,其中有类似的数据,意味着其中有带有街道名称的房子#,我想在房子#&中获取该列.街道名称


13480单点车道
4420 Douglas Ave. E
10655桦木街


我想分开展示房子#&街道名称
所以我需要

I have a columna name "home address" in which i have data like that ,mean there is house# with the street name,I want to fetch the column in house# & streetname


13480 lone point lane
4420 Douglas Ave. E
10655 birch St


I want to show separate the house# & streetname
so i need

house#  streetname

13480   lone point lane

4420    Douglas Ave

10655   birch St




[edit]添加了代码块-OriginalGriff [/edit]




[edit]Code block added - OriginalGriff[/edit]

推荐答案

您可以使用string.Split方法在空间上将其断开,但这会给您4个字符串对于您的第一个示例.我会使用简单的蛮力方法:
You could use the string.Split method to break it on space, but that would give you 4 strings for the first of your examples. I would go with the simple brute force method:
string s = "13480 lone point lane";
int index = s.IndexOf(' ');
if (index > 0)
    {
    string number = s.Substring(0, index);
    string street = s.Substring(index + 1);
    ...
    }


这篇关于SQL要求对街道名称&中的家庭地址进行拆分住宅 #的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆