Counts the number of times that a specified substring appears within a character string.
Category: | Character |
Restriction: | I18N Level 1 functions should be avoided, if possible, if you are using a non-English language. The I18N Level 1 functions might not work correctly with Double Byte Character Set (DBCS) or Multi-Byte Character Set (MBCS) encodings under certain circumstances. |
Tip: | You can use the KCOUNT function for DBCS processing, but the functionality is different. See DBCS Compatibility . |
specifies a character constant, variable, or expression in which substrings are to be counted.
Tip | Enclose a literal string of characters in quotation marks. |
is a character constant, variable, or expression that specifies the substring of characters to count in string.
Tip | Enclose a literal string of characters in quotation marks. |
is a character constant, variable, or expression that specifies one or more modifiers. The following modifiers can be in uppercase or lowercase:
i | ignores character case during the count. If this modifier is not specified, COUNT only counts character substrings with the same case as the characters in substring. |
t | trims trailing blanks from string and substring. |
Tip | If the modifier is a constant, enclose it in quotation marks. Specify multiple constants in a single set of quotation marks. Modifier can also be expressed as a variable or an expression. |