Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 4th, 2005, 03:02 AM
maria_arif maria_arif is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 4 maria_arif User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 46 sec
Reputation Power: 0
trim string

hi there,

i would like to ask about trim/mid.
my problem is like this.

let's say i have string like these:

var1 = F41
var1 = DG48
var1 = VKU52

what i wat to do is i just want to take numbers from that string where

the output will become like these:
var1 = 41
var1 = 48
var1 = 52

normally i use mid before this, but if i use mid, i have to make sure

the starting char and it's lenght like this:
mid(var1, 2,2)

but i cannot do like this because the number sometimes at the 2nd

character, sometimes at the 3rd character and etc.

how to do the coding?
thank you very much and i really appreciate for any help given.

Reply With Quote
  #2  
Old April 4th, 2005, 03:27 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,181 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 98259 Folding Title: Advanced FolderFolding Points: 98259 Folding Title: Advanced FolderFolding Points: 98259 Folding Title: Advanced FolderFolding Points: 98259 Folding Title: Advanced FolderFolding Points: 98259 Folding Title: Advanced Folder
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 19 m 32 sec
Reputation Power: 699
well, if the number is only going to be two chars long, you could use right

Code:
 var1 = right("F41",2)

hope this helps
__________________
Look! Its a ShemZilla



Reply With Quote
  #3  
Old April 4th, 2005, 09:14 AM
Naive Amoeba Naive Amoeba is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Manchester, England
Posts: 48 Naive Amoeba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 26 m 38 sec
Reputation Power: 4
Quote:
Originally Posted by nofriends
well, if the number is only going to be two chars long, you could use right

Code:
 var1 = right("F41",2)

hope this helps


Actually, yeah. I've wondered before how to separate alphabetical characters from numbers. Is there a set method?

Reply With Quote
  #4  
Old April 4th, 2005, 09:54 AM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
Click here for more information.
 
Join Date: Feb 2005
Location: Dreamland
Posts: 12,813 mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 4 Months 4 Weeks 1 h 18 m 54 sec
Reputation Power: 1567
Quote:
Originally Posted by Naive Amoeba
Actually, yeah. I've wondered before how to separate alphabetical characters from numbers. Is there a set method?


I had the same issue a few weeks back and Memnoch gave me the perfect function to use.

Go here and check it out.

Hope this helps you.
Comments on this post
nofriends agrees: good reference

Reply With Quote
  #5  
Old April 4th, 2005, 07:48 PM
maria_arif maria_arif is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 4 maria_arif User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 46 sec
Reputation Power: 0
hello there..

thank you very much to all repliers..

to mehere i'll go to that suggested link and try the solution now.

thanks.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > trim string


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway