The MNTSLength method

This method returns the number of characters in the multibyte character string s, not including any trailing space characters.

int MNTSLength(const char *s, int nbytes = ITLocale::ScanToNul) const

The characters not included in the count are the ASCII space character and any multibyte characters equivalent to the ASCII space character. Space characters embedded in the string before the series of spaces at the end of the string are included in the count.

The nbytes parameter specifies the length of the corresponding string s. You can provide an integer to specify the number of bytes in s. Or you can use the constant ITLocale::ScanToNul (the default) to specify that s is a null-terminated string.

If there is an error, this method returns -1. Call ITLocale::GetError() to retrieve a specific error message.