title case - a string processing function that returns a string argument with every first letter of a word in uppercase while leaving existing uppercase letters unchanged
tcase(string)
tcase works with variable-, fixed-length and constant strings. The result can be assigned to a variable or fixed-length string, and passed to a string parameter or function result.
tcase has no effect on strings that were previously processed by pcase or ucase.
' SharpBASIC title case programming example
' -----------------------------------------
incl "lib/sys.sbi";
dim text: str = "HELLO, beautiful world!";
dim s: str;
main do
s = tcase(text);
print(s);
s = pcase(text);
print(s);
end
Output:
HELLO, Beautiful World!
Hello, Beautiful World!