Jump to content

How to tell if string is a digit/letter?


ozone
 Share

Recommended Posts

GOAL = Convert "00,03,01,001,1,0,0,01,00,00,00,0,HELLO" to an array of either numbers or strings.

$data = StringSplit("00,03,01,001,1,0,0,01,00,00,00,0,HELLO", ",")

But here is the problem.

Number($data[1]) returns 0

Number($data[13]) returns 0

That's a problem... Ideas in how to preserve existing strings?

Edited by ozone
Link to comment
Share on other sites

GOAL = Convert "00,03,01,001,1,0,0,01,00,00,00,0,HELLO" to an array of either numbers or strings.

$data = StringSplit("00,03,01,001,1,0,0,01,00,00,00,0,HELLO", ",")

But here is the problem.

Number($data[1]) returns 0

Number($data[13]) returns 0

That's a problem... Ideas in how to preserve existing strings?

<{POST_SNAPBACK}>

Ahh, maybe I'm just having a slow day haha. The solution would be:

If StringIsAlNum($data[1])=1 Then $data[1]=Number($data[1])

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...