如何快速的获取字符串中的某个字符,
字符串全是 “大中小” 如何快速把 这个分割成三个字符 并且放到 3个变量中去。 我用 mid()函数 但是感觉处理起来不快, 因为一次要处理 上 万个 这样的字符。 请问大家还有什么其它的方法吗
[解决办法]
Option ExplicitPrivate Sub Command1_Click() Dim strDa() As String Dim strXiao() As String Dim strZhong() As String Dim strDaPara As String Dim strZhongPara As String Dim strXiaoPara As String Dim intP As Integer strDa = Split(Text1.Text, "大") strZhong = Split(Text1.Text, "中") strXiao = Split(Text1.Text, "小") Debug.Print strDa(0) For intP = 0 To UBound(strDa) - LBound(strDa) - 1 strDaPara = strDaPara & "大" Next intP For intP = 0 To UBound(strZhong) - LBound(strZhong) - 1 strZhongPara = strZhongPara & "中" Next intP For intP = 0 To UBound(strXiao) - LBound(strXiao) - 1 strXiaoPara = strXiaoPara & "小" Next intP Debug.Print strDaPara Debug.Print strZhongPara Debug.Print strXiaoParaEnd SubPrivate Sub Form_Load() Text1.Text = "大中小小中大大大中大中小小中大大中小小中大大大中中小小中大大大中中小小中大中小小中大"End Sub