问题描述
一个月前,我问你如何将门牌号和共同地址的街道分开。 这个问题得到了很好的回答。解决方案如下。
private static (string street,string number) SplitStreet(string value)
{
var match = Regex.Match(value,@"\p{L}{2,}(?:\s\p{L}+)*");
string street = match.Value;
string number = (match.Index > 0)
? value.Substring(0,match.Index)
: value.Substring(match.Index + match.Length);
return (street,number.Trim());
}
现在的问题是这个函数不能分开看起来像这样的街道:
- Ernst-Thälmannstrasse 8
- 东 50 街 203 号
我尽力了,但找不到解决此问题的方法。 也许我没有为这两个例子使用正确的模式。
有人遇到同样的问题并找到了解决方案吗?
感谢您的帮助
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)