Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Question] Splitting up inputs correctly.

I understand the title is rather unclear; what I'm looking for is a proper way to take the content of a message, and turn it into a single string, even if it includes spaces. Currently, what I have is on(chat:message, function (msg) { msg.content.replace("!foo bar etc more","").split(" ") doing stuff with the above Is there any way to take the 'more' part and use it as a single string, even if it contains spaces? Thanks, James W.
1374506680
Alex L.
Pro
Sheet Author
James W. said: I understand the title is rather unclear; what I'm looking for is a proper way to take the content of a message, and turn it into a single string, even if it includes spaces. Currently, what I have is on(chat:message, function (msg) { msg.content.replace("!foo bar etc more","").split(" ") doing stuff with the above Is there any way to take the 'more' part and use it as a single string, even if it contains spaces? Thanks, James W. you can always use this to handle your chat commands: <a href="https://app.roll20.net/forum/post/235448/script-chat-command-handler#post-235448" rel="nofollow">https://app.roll20.net/forum/post/235448/script-chat-command-handler#post-235448</a>