#How to extract only special chars from String input?

1 messages · Page 1 of 1 (latest)

spare forum
#

How can I make it so that it only extracts "+","-","*","/" from the input like it did with the numbers?

peak havenBOT
#

<@&987246399047479336> please have a look, thanks.

spare forum
#

How to extract only special chars from String input?

soft talon
#

thatll leave you with only the symbols

#

you'd use replaceAll, with a regex looking for any non-arithmetic characters

#
var regex = ...;
var newStr = oldStr.replaceAll(regex, "");```
#

newStr would contain everything after the replacement

#

the replacement would look for any non-arithmic characters