我有以下字符串
- Pri."Priority Description"
如何解析Pri
和Priority Description
?在excel中,我试试这个=MID(A1,FIND("\",A1)+1,FIND("\",A1,4)-FIND("\",A1)-1)
答案 0 :(得分:0)
首先输入以下 UDF
Public Function GrabString(s1 As String, s2 As String, s3 As String) As String
Dim L2 As Long, L2x As Long, sx As String
L2 = Len(s2)
L2x = InStr(s1, s2) + L2
sx = Mid(s1, L2x)
GrabString = Left(sx, InStr(1, sx, s3) - 1)
End Function
此 UDF 将返回由其他两个字符串包含的子字符串。
然后 A1中的数据 输入:
=GrabString(A1,"- ",".")
并在 C1 中输入:
=GrabString(A1,"""","""")
显示: