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