Splitting A String (not a list) ?!

Oli Mason's icon

Hi everyone,

I have some serial data coming in from a mobile phone, in the format '079892673648contentofthemessage'

What i need to do is split the list after something like the 13th number, giving me 2 messages that i can then route.

[zl objects] do not seem to work as I'm assuming it doesn't qualify as a list.

I know this will possibly lead to [sprintf] or [regexpr] but I have tried using them and failed!

Can anyone help?

Regards,

Oli

Oli Mason's icon

Hi thanks for the quick response!

The first example did the trick!

Sorry what did you mean by "cannot be represented?"

Regards,

Oli

Oli Mason's icon

Ah I get you, I did notice that and wonder why?

Ive learnt something today! :)

Thanks!

frogger123's icon

Thanks Nicolas, this helped me out as well!!

Peter Castine's icon

Sigh. Somebody else can explain to Oli about 32-bit integers. There are about 2,147,483,647 threads discussing this.

I just wanted to remind people that "079892673648" can be represented in Max, if you represent it as a symbol. I've not looked at Nicolas' patch, but the task can be done simply enough using [regexp].

Oli Mason's icon

Sorry to make you sigh peter i do apologies.

If you check this post is now a year old and the kind people on the forum have helped me to find a solution.

I was always taught 'if you cant say anything nice dont say anything at all'

Food for thought maybe...