- Categories:
String & binary functions (Case Conversion)
INITCAP¶
返回输入字符串,其中每个单词的第一个字母为大写,后续字母为小写。
语法
实参
expr字符串表达式。
'delimiters'一个或多个字符的字符串, INITCAP 将其用作输入表达式中单词的分隔符:
-
If
delimitersisn’t specified, any of the following characters in the input expressions are treated as word separators: -
If
delimitersis specified, the specified value overrides all of the characters listed above.
支持任何 UTF-8 字符,包括空格字符,并且区分大小写。
Must be enclosed in single quotes, for example
', '(delimiters in this example are,and blank spaces).When specified as an empty string (that is,
''), INITCAP ignores all delimiters, including whitespace characters, in the input expression. The input expression is treated as a single, continuous word. The resulting output is a string with the first character capitalized (if the first character is a letter) and all other letters in lowercase.-
返回
此函数返回 VARCHAR 类型的值。
排序规则详细信息
Arguments with collation specifications currently aren’’t supported.
示例
此示例使用默认分隔符提供不同语言的各种输出:
These examples specify delimiters using the delimiters argument: