.net框架拆分功能无法正常工作

时间:2015-08-23 05:50:59

标签: .net vb.net

我在VB.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

但它似乎将文本在文本中找到的每一个点上的文本分开,而不仅仅是“。”(点+空格)位置。有什么方法可以解决它并让它正常工作吗?

1 个答案:

答案 0 :(得分:1)

您必须use var www = new WWW ("file://" + Application.dataPath.Substring (0, Application.dataPath.LastIndexOf ("/")) + "/result.wav"); AudioClip myAudioClip= www.audioClip; while (!myAudioClip.isReadyToPlay) yield return www; gameObject.GetComponent<AudioSource> ().audio.clip = myAudioClip; audio.Play ();

overloads on the String.Split method to do split based on multiple characters