2015-08-23 49 views
1

我写了下面的功能在VB.net:.NET框架分割功能正常

Public Function split_ondotspaces (ByVal thetext As String) As String() 
    thetext = thetext.Replace("\n", ". ") 
    Dim sntncs() As String 
    Dim sperator As String = ". " 
    sntncs = thetext.Split(sperator) 
    Return sntncs 
End Function 

,但它似乎不仅在文字上分割的每一个点,它发现在文本“ 。“(点+空格)位置就像它应该。有什么方法可以修复它并让它正常工作?

+0

很抱歉,如果这似乎完全没有经验。我是编程新手,和stackoverflow.com。 – JackBixuis

回答

1

你必须useoverloads on the String.Split method to do split based on multiple characters

sntncs = thetext.Split(New String() {sperator}, StringSplitOptions.RemoveEmptyEntries) 
+0

谢谢,它正在工作,就像我需要它 – JackBixuis

+0

被骗了........... –