ASP Hosting sale!
Double disk space and transfer for FREE!
Limited time offer! Act Now!

aspdev | articles | tutorials | forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get the last 5 character from a string in ASP

 
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming
View previous topic :: View next topic  
Author Message
tony



Joined: 08 Dec 2004
Posts: 4

PostPosted: Wed Dec 08, 2004 9:37 am    Post subject: How to get the last 5 character from a string in ASP Reply with quote

Hi,

I have a very long string and I want to get the last 5 characters from this string and save them in my Access database. I know how to save something in Access from ASP but I don't know how to extract the last 5 characters from my string. How do I do this in ASP?



-- Tony
Back to top
View user's profile Send private message
paul



Joined: 11 Oct 2004
Posts: 128

PostPosted: Wed Dec 08, 2004 11:58 am    Post subject: Reply with quote

Hi Tony,

You can use the Right VBScript function to get the last 5 characters of your string. Here is how:

Code:

sLast5Chars = Right(sString, 5)




Paul Smile
_________________
World Countries | Survival Skills
Back to top
View user's profile Send private message
tony



Joined: 08 Dec 2004
Posts: 4

PostPosted: Wed Dec 08, 2004 12:23 pm    Post subject: Reply with quote

Thanks Paul

The Right function did the job.



-- Tony
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group

SQL Tutorial