Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Need help on VBscript in asp
Old 01-05-2006, 04:01 AM Need help on VBscript in asp
waller's Avatar
Skilled Talker

Posts: 59
Location: North Borneo.
Trades: 0
I use vbscript in an asp file.
How can i take the last string in a variable.
For example:

abc="hello123"
newabc=???(abc)

and i only want the last string, that is "3".
means, if I do...

Response.Write newabc

The output will be : 3
__________________
$id ="waxxer";
$id = str_replace('x', 'l', $id);
echo $id;
echo " and Marj";
waller is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-05-2006, 05:25 AM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
You mean you want the last character of the string?
You can use the Right() finction.
newabc = Right(abc, 1)

The syntax is
Right(InputString, NumberOfCharacters)

So Right("This is my string", 4) will return "ring"

(There is also a Left function which does the same sort of thing, but obviously returns characters from the left of the string)
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 01-05-2006, 06:40 AM
waller's Avatar
Skilled Talker

Posts: 59
Location: North Borneo.
Trades: 0
Thanks Man. It worked just fine.
__________________
$id ="waxxer";
$id = str_replace('x', 'l', $id);
echo $id;
echo " and Marj";
waller is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need help on VBscript in asp
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26741 seconds with 12 queries