Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to remove $ from $123.
#1
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi
I have variable which has $123 as a value.
I want to remove $ from it so that i can perform mathematical operation on that variable.
Can any one tell me how to remove $ ?

Thanks in Advance
Reply
#2
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi
You can use text function :
Code:
a=Cstr($123)
b=mid(a,2,len(a))  'b take value "123"
use after conversion function to converte your variable to integer or other
Reply
#3
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi Sudhir,

it can be done in many ways as given below.

Way 1:

Code:
x="$123"
   x_val=Right(x,(len(x)-1))        ' use the "Right" built-in function & retrieve required value
  The above x_val contains only  "123".

Way 2:
Code:
x="$123"
  x_val=""
   For i=1 to len(x)
        y=mid(x,i,1)
           If (isnumeric(y)=True )Then
                   x_val=x_val&y
          End If
   Next

   msgbox x_val


Here above 'x_val' variable contains only "123"


Simillarly.. we can go for may ways .....
Just try from ur end & see.....
Reply
#4
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi elsekra and Srikhant

Thanks a lot. Both sol works for my script.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to remove the spaces from a string Anand 7 29,671 08-12-2019, 04:47 PM
Last Post: sreekanthP
  How to remove text in the webedit silpavinod 3 13,879 07-12-2018, 11:08 AM
Last Post: vijaychourasiya0109@gmail.com
  how to remove null values in array venkatesh9032 0 2,910 02-19-2014, 06:51 PM
Last Post: venkatesh9032
  how to remove values from an Array. ACCBAJPA 5 5,207 08-23-2013, 12:18 PM
Last Post: ssvali
  How to remove space between webelements silpavinod 2 3,326 10-11-2012, 02:53 PM
Last Post: silpavinod

Forum Jump:


Users browsing this thread: 1 Guest(s)