Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Substring
#4
Not Solved
Hi,
Please find the below code
Code:
Dim MyString, MyArray, Msg
MyString = "VBScriptXisXfun!"
MyArray = Split(MyString, "x", -1, 1)
' MyArray(0) contains "VBScript".
' MyArray(1) contains "is".
' MyArray(2) contains "fun!".
Msg = MyArray(0) & " " & MyArray(1)
Msg = Msg   & " " & MyArray(2)
MsgBox Msg


The above string "VBScriptXisXfun!" was splited into three parts as x is appeared twice in the string.
In the same way you can able to split the string "The annual Premium for this coverage is $1,052.00" based on $ character.
Reply


Messages In This Thread
Substring - by Anna - 07-16-2008, 07:11 PM
RE: Substring - by anemuday - 07-20-2008, 10:36 PM
RE: Substring - by bhanu_bp7 - 07-21-2008, 03:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  VBA Code to read a substring Dwarak Calayampundi 2 2,939 10-04-2016, 09:15 PM
Last Post: venkatesh9032

Forum Jump:


Users browsing this thread: 2 Guest(s)