VB.net 字符串 分割 及 重新倒序组装_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > VB.net 字符串 分割 及 重新倒序组装

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

 2013/8/21 15:49:40  freeliver54  博客园  我要评论(0)
  • 摘要:'''<summary>'''splitwith">>>>",andinvertedorder'''</summary>'''<paramname="groupNamePath">123>>>>abc>>>>456</param>'''<returns>456>abc>123</returns>'''<remarks><
  • 标签:.net net 字符串 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 - 1 To 0 Step -1
            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

 

发表评论
用户名: 匿名