User Tools

Site Tools


tcase

Table of Contents

tcase

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

syntax

tcase(string)

  • the string argument can be a string variable, constant, function or literal

See also acase, lcase, pcase, ucase

details

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.

example

' 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!

tcase.txt · Last modified: 2023/06/26 00:40 by admin