Get the length of given string once it is trimmed (removed space)

string:get_trimmed_length(STRING $string) : STRING

$s = " hi "

string:get_trimmed_length($s)
#=> "2"

string:get_length($s)
#=> 4

$s2 = "\t   hi\n\n\n\n "
string:get_trimmed_length($s2)
#=> "2"

Copyright ©2013-2022 SunSed®. All rights reserved.