Link to home
Start Free TrialLog in
Avatar of andieje
andieje

asked on

string maniupationg question

Hi

I have some strings that look like this

 . 1/10 .
 . 2/45 .

this is: space, full stop, space, one or more numbers , forward slash, one or more numbers, space, fullstop, space

what i need to do is extract the bit in the middle (one or more numbers , forward slash, one or more numbers)

e.g 1/10, 2/45

and then if the first number happens to be 0, convert it to 1

e.g. 0/10 --> 1,10

how would i do this?

thanks
andrea
ASKER CERTIFIED SOLUTION
Avatar of Ravi Singh
Ravi Singh
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gangwisch
gangwisch

dim mystring as string=". 1/10 . 2/45"
dim a() as string=mystring.split("/")
for i as integer=0 to a.getupperbound(0)
dim finalvalue as string=""
finalvalue=iif(int(a(i))=0,"1",a(i)) & "," & a(i+1)
msgbox(finalvalue)
next