Forum Moderators: open

Message Too Old, No Replies

basic asp question

how to remove a leading "$"

         

click watcher

5:34 am on Feb 20, 2002 (gmt 0)



using vbscript asp

i've a string which has a value of...

$123.45 (or infact any number with a leading $ sign)

i need to set a variable to be the string value but without the leading $ sign,

how should i proceed... please!!!

cyril kearney

5:56 am on Feb 20, 2002 (gmt 0)

10+ Year Member



strWk = "$123.45"
strWk = Right(strWk, (Len(strWk) - 1) )

strWk now contains "123.45"

You can manipulate string data with Left, Right and Mid.
Len gives you the length of a string.

wardbekker

5:57 am on Feb 20, 2002 (gmt 0)

10+ Year Member



Dim str

str = "$123.45"

str = replace(str, "&", "")

response.write "good luck!" ;-)

click watcher

6:35 am on Feb 20, 2002 (gmt 0)



hey thanks guys !!!