Jump to content

Evaluating characters


Recommended Posts

I'm writting a function to store/read multi-dim arrays to/from files

When I save the an array the first line is the array dimensions with the seperator char inbetween like this:

'20|5' or '234,12'

Basically it's <number><seperator><number>

When I read the file, I get the first line and evaluate it. Problem is I can't seem to get that seperator character...

What do I need to do to single out the seperator (non-numeric). I tried IsString and IsNumber on each char in the string but they all return back the same result.

Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

Link to comment
Share on other sites

  • Moderators

Or in case you want to get the separator out of that string, use

StringRegExpReplace($string, "[0-9]", "")

I'm not sure I followed what the OP was wanting... but I understood it it to be something like:
#include <array.au3>
$aSeperate = StringRegExp($aString, '(\d+)\D(\d+)', 3)
_ArrayDisplay($aSeperate);Should show all the numbers [0] Contains before separator [1] contains after, the separator would be any "Non" digit character

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...