VB.net 字符串 分割 及 重新倒序组装

    ''' <summary>
''' split with ">>>>" , and inverted order
''' </summary>
''' <param name="groupNamePath"> 123>>>>abc>>>>456 </param>
''' <returns> 456 > abc > 123 </returns>
''' <remarks></remarks>
Protected Function transGroupNamePath(ByVal groupNamePath As String) As String
Dim strResult As String = ""
Dim strArray As String() = Regex.Split(groupNamePath, ">>>>") For i As Integer = strArray.Length - To Step -
If Not strArray(i) = "" Then
If strResult = "" Then
strResult = strResult & strArray(i)
Else
strResult = strResult & " > " & strArray(i)
End If
End If
Next
transGroupNamePath = strResult
End Function
上一篇:C#中分割字符串输出字符数组


下一篇:Codeforces Round #257 (Div. 2) E题:Jzzhu and Apples 模拟