getQuotedText function
Implementation
String getQuotedText(
String text
)
{
final quotedText =
text
.replaceAll( '\\', '\\\\' )
.replaceAll( '\n', '\\n' )
.replaceAll( '\r', '\\r' )
.replaceAll( '\t', '\\t' )
.replaceAll( '"', '\\"' )
.replaceAll( '\'', '\\\'' );
return '"$quotedText"';
}