有以下这样一个字符串,如何提取出最后一个“/”之前的字符,结果如下
字符串C:/APP\workspace/q3p-web/bin/com/inetpsa/q3p/web/calendrier/struts/transactions/ge...
字符串 C:/APP\workspace/q3p-web/bin/com/inetpsa/q3p/web/calendrier/struts/transactions/gestioncalendrier/Messages_fr_FR.properties
结果 C:/APP\workspace/q3p-web/bin/com/inetpsa/q3p/web/calendrier/struts/transactions/gestioncalendrier 展开
结果 C:/APP\workspace/q3p-web/bin/com/inetpsa/q3p/web/calendrier/struts/transactions/gestioncalendrier 展开
2014-10-07
展开全部
Private Sub Command1_Click()
Dim myData() As String, myOutput As String, myInputStr As String, i As Integer
myInputStr = "C:/APP\workspace/q3p-web/bin/com/inetpsa/q3p/web/calendrier/struts/transactions/gestioncalendrier/Messages_fr_FR.properties"
myData = Split(myInputStr, "/")
For i = 0 To UBound(myData) - 1
myOutput = myOutput & myData(i) & "/"
Next
myOutput = Left(myOutput, Len(myOutput) - 1)
MsgBox myOutput
End Sub
Dim myData() As String, myOutput As String, myInputStr As String, i As Integer
myInputStr = "C:/APP\workspace/q3p-web/bin/com/inetpsa/q3p/web/calendrier/struts/transactions/gestioncalendrier/Messages_fr_FR.properties"
myData = Split(myInputStr, "/")
For i = 0 To UBound(myData) - 1
myOutput = myOutput & myData(i) & "/"
Next
myOutput = Left(myOutput, Len(myOutput) - 1)
MsgBox myOutput
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询