Splitting apart a message

joedan06's icon

Is there a way to split in message into pieces based on a character?
Example:
the message box is set to "help~me"

can i split that into two strings and look at only the "help" part of the message?

Luke Hall's icon

Try using a [regexp ~ @substitute " "] to convert the ~tildes~ into spaces.

lh

joedan06's icon

how would I implement something like that? Do I just paste that into an object box? Sorry, if these are newb questions but I'm fairly new to max.

Luke Hall's icon

Yeh just paste everything inside the [square brackets] into an object box. Here's an example patch as well so you can see, copy it all and paste it into a new patching window.

lh

Max Patch
Copy patch and select New From Clipboard in Max.

joedan06's icon

Awesome, that's exactly what I needed. I had tried copying your first post, but I was copying the brackets so that's why it was working for me. Thanks a lot!