Question: StringTools Questions (Maple 2020)

I was reviewing the StringTools features and I'm curious about some parts of it.

(1)     Here is a section from the StringTools[Length] help topic:

Notice that, like length, the Length command counts the number of bytes in the string, not the number of characters.
Length("d303251cembre");
                               9
 
When I execute the command in Maple 2020, it actually returns 13 instead of 9.  The length command also returns 13.  I do not understand the information from StringTools[Length] help.  I looked back to Maple 18 and it did not include these lines in the help topic.
 
(2)   I am confused about the rng argument in StringTools commands of LowerCase, UpperCase and OtherCase.  It seems that these commands consider -2 as the last character in the string.  The help topic shows this:
 
UpperCase("abcdefghij", 3 .. -2);
                          "abCDEFGHIJ"
 
I'm expected to use -1 as the last character such as:
 
S:="This is a test";
S[-4..-1];
                       "test"
 
(3)  Next, I looked at StingTools[SubString].  The help topic gives the following example:
 
SubString("abcdef", -5 .. -3);
                             "bcd"
That works like I expected.  So, -1 is the last character for SubString.
 
Thanks,
Lee
 
Please Wait...