I need to remove the first and last character of a String
variable, I tried to use substring
for this, but it is giving the following error:
String index out of range
And I'm not finding a way to do this, I've done it so far:
conteudoLote.replace("[", "(").replace("]",")").substring(1,(conteudoLote.length()-1))
Variable content:
((1,'SCAB17003066B','Suprimento com Defeito e com Resíduo','Lexmark International','60FBX00','Fraco',15),(1,'SCAB160632D9FRET','Vazio','Lexmark International','50FBX00',null,50), (1,'SCAB17003066B','Vazio','Lexmark International','60FBX00',null,null), (1,'SCAB1714435C2','Vazio','Lexmark International','50F0Z00',null,null))
Is there any way to remove the first and last character of a string?