ProperCase - Built-in String Function¶
Purpose¶
Formats a string by upper- and lowercasing the input value using optional rules.
Syntax¶
ProperCase(str1 [, str2])
Arguments¶
| Argument | Required | Description |
|---|---|---|
str1 |
Yes | String to be formatted |
str2 |
No | Overrides the default behavior of capitalizing the first alpha character after each space |
Returns¶
Variant with a string (VT_BSTR) value
Example¶
Dim sName
Let sName="JOHN DOE"
Return ProperCase(sName) // returns "John Doe"
Return ProperCase("sentence one. sentence two", ".")
// returns "Sentence one. Sentence two"
Return ProperCase("12ABcdef !gH", "aDE!") // returns "12AbcDEf !Gh"
Return ProperCase("1, string: ONE. 2, string: TWO.", ":t")
// returns "1, string: One. 2, String: Two"
See Also¶
Notes¶
- When the arguments cannot be converted to the specified type a runtime error is generated.
- The first alpha character in string is capitalized when a non-alpha character is found that matches a non-alpha character in override string.
- When the override string contains an upper case alpha character all corresponding characters in string will be upper cased.
- If in override string a lower case alpha character is used all corresponding characters in string will be lower cased.