|
-
January 19th, 2004, 09:46 AM
#1
2 string manipulation questions....
Hi, 
Question 1:
OK, I have a string called MyString as follows:
MyString = "[Letters]ABCDE[Numbers]1234"
I want to click a button and for it to search the string for [Letters] then display in 'MyStringNew' just the letters (ABC, etc), i.e. not the numbers section.
Question 2:
In the above string, how can I also show everything after [Letters] to the end of the string.
Thanks!!
Mark
-
January 19th, 2004, 11:24 AM
#2
Ans to Q2
newVal = Right(mystring, Len(mystring) - (InStr(1, mystring, "]")))
Before Answering Q1,
Will the string always be in the format you have shown?
If you find my answers helpful, dont forget to rate me 
-
January 19th, 2004, 12:14 PM
#3
Mark assuming it's in this fomat, then you retrieve the letters part with the following
letters = left(right(mystring,len(mystring) - instr(1,mystring,"]")),instr(1,right(mystring,len(mystring) - instr(1,mystring,"]")),"[")-1)
and for the numbers:
numbers = Right(mystring, Len(mystring) - InStr(10, mystring, "]"))
If you find my answers helpful, dont forget to rate me 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|