我有一个类似于这个的字符串:
男孩对他的母亲说:“我可以 吃一些糖果吗?”
如果我对它进行普通的String.Split
,我会得到:
{ 'The', 'boy', 'said', 'to', 'his', 'mother', '"Can', 'I', 'have', 'some', 'candy?"' }
I want an array like so:
{ 'The', 'boy', 'said', 'to', 'his', 'mother', 'Can I have some candy?' }
显然,我可以逐个字符地循环,并跟踪我是否在字符串中等等...但是有没有更好的方法?也许使用正则表达式?