I'm writing a parser for some LISP files. I'm trying to get rid of leading whitespace in a string. The string contents are along the lines of:
:FUNCTION (LAMBDA
(DELTA
PLASMA-IN-0)
(IF
(OR
(>=
#61=(+
(*
1
DELTA)
PLASMA-IN-0)
100)
(<=
#61#
0))
PLASMA-IN-0
#61#))
The tabs are all printed as 4 spaces in the file, so I want to get rid of these leading tabs.
I tried to do this: string.replaceAll("\\s{4}", " ")
- but it had no effect at all on the string.
Does anyone know what I'm doing wrong? Is it because it is a multi-line string?
Thanks
String.trim();
Should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With