|
-
May 7th, 2001, 03:09 AM
#1
String Variable
I know that the 1st character of a unknown string variable is a number & the following characters are also numbers but do not know exactly how many following characters are numbers, so how can i exact only numbers from this string starting from the 1st character?
-
May 7th, 2001, 03:20 AM
#2
Re: String Variable
This leaves all the non numbers from a string
dim strInput as string
dim strResult as string
strInput = "Th1s 15 a t35t 5tr1ng"
for t=1 to len(mystring)
if Isnumeric(mid(strInput,t,1)) then
' this is a number
strResult = strResult & mid(strInput,t,1)
end if
next t
' after this loop, strresult should have the value 1153551
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
-
May 7th, 2001, 03:35 AM
#3
Re: String Variable
How can i delete the first 3 characters of a string?
-
May 7th, 2001, 03:39 AM
#4
Re: String Variable
be sure the string is > 2 char
if len(mystr)> 2 then
mystr= right(mystr,len(mystr)-3)
end if
Special thanks to Lothar "the Great" Haensler, Tom Archer, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
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
|