1
I got the string:
var str = "Quantidade [12]";
I need to recover the string but remove the space and the [12], IE, I need to return only the value: Amount.
In case the string is var str = "Quantidade máxima [12]";
, I need to get all the text on the left of the square bracket, that is, the value Maximum quantity.
Both the size of the strings and the value between the brackets can change, the mask would be basically:
var str = "string [*]";
I will always only have this pair of brackets and a numerical value inside. How can I recover the entire string by removing the space and the numerical value?
But when you have something like "Maximum quantity [12]", I need to return "Maximum quantity" without the brackets, number and last space.
– Fábio Jânio
this information is there, I inform that the size of the strings can change and even suggest what would be a mask.
– Fábio Jânio