Good morning everyone,
Maybe owing to my comprehension difficulties in English, I don't understand well what the trim function does.
Does it remove white spaces / blank only at the beginning and at the end of a string or all the white spaces into the string are replaced?
Will it work with carriage return characters as well (\n)?
Thank you.
what exactly does the trim function do?
Moderator: Martin
- tsolignani
- Posts: 187
- Joined: 12 Jan 2019 11:53
- Location: Vignola, Mo, Italy
- Contact:
Re: what exactly does the trim function do?
Yes, all white space including tab (\t), newline either \r or \n. Example
If you look at debug dialog, b show 123 below the line. While c use the trimmed a, and it shows 123 right next to the world.
Code: Select all
a = "\tHello World\t\n\r";
b = a + "123";
c = trim(a) + "123";
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
- tsolignani
- Posts: 187
- Joined: 12 Jan 2019 11:53
- Location: Vignola, Mo, Italy
- Contact:
Re: what exactly does the trim function do?
Thank you. So it does work only on white spaces left or right and not in the middle.