Reputation: 21
When you have a string in Rascal like this:
"\n\tThis is a specification of a toy Transaction.\n\tVia a transaction money
can be transfered between two accounts\n"
Or
This is a specification of a toy Transaction.
Via a transaction money can be transfered between two accounts
How can I remove the whitespace in the middle of the string?
My solution now is to call a function that replaces '\n', '\t', and '\r' but this doesn't seem like a sustainable solution. Also, the function trim only remove whitespace at the beginning and end.
Upvotes: 2
Views: 261