.trim_left()
and .trim_right()
only trim the leading and trainling whitespace respectively.\
(backslash) character has a special meaning. For technical reasons, in all strings, it must be properly escaped, by convention by adding another \
in front of itself, to avoid being interpreted as a special character. For example, if you mean to write the exact string "\n"
you must in fact write \\n
, otherwise \n
will be interpreted as a line break."\\"
string, and an escaped backslash (that behaves as a literal "\"
string character) must in fact be escaped twice, once for being in a string, and once for being in a Regex: you have to write "\\\\"
to result in the Regex syntax \\
which in turn matches the literal "\"
string.start
and end
characters. Some rules apply:end
is not specified, all the characters after start
are returned.end
must be ≥ start
.