How to get arithmetic value out of strings with varying length?
ex:
-setHealth 500 or -setMana 200
The desire would be to capture and use the arithmetic value for both commands.
If the commands are the same length
ex: -setHth 500 and -setMna 10000
Then substring does the job but, if the strings have different lengths then substring won't work.
C# equivalent
This captures anything in the string after the space. How can this be done in WorldEdit?
Thanks!
P.S. Excuse the poor thread title, had in mind to ask if String.Contains() was a possibility.
ex:
-setHealth 500 or -setMana 200
The desire would be to capture and use the arithmetic value for both commands.
If the commands are the same length
ex: -setHth 500 and -setMna 10000
Then substring does the job but, if the strings have different lengths then substring won't work.
C# equivalent
Code:
msg.Substring(msg.IndexOf(" "), msg.Length);
Thanks!
P.S. Excuse the poor thread title, had in mind to ask if String.Contains() was a possibility.
Last edited: