StringExtensionsCapitalize Method (String, Boolean) |
Capitalizes the first letter of each word assuming that words are separated by a single space.
Namespace:
Enkoni.Framework
Assembly:
Enkoni.Framework (in Enkoni.Framework.dll) Version: 1.3.0.1
Syntaxpublic static string Capitalize(
this string source,
bool keepExistingCapitals
)
<ExtensionAttribute>
Public Shared Function Capitalize (
source As String,
keepExistingCapitals As Boolean
) As String
public:
[ExtensionAttribute]
static String^ Capitalize(
String^ source,
bool keepExistingCapitals
)
[<ExtensionAttribute>]
static member Capitalize :
source : string *
keepExistingCapitals : bool -> string
Parameters
- source
- Type: SystemString
The string that must be capitalized. - keepExistingCapitals
- Type: SystemBoolean
Indicates if any capitals that are already in the string must be preserved or must be lowered.
Return Value
Type:
StringThe capitalized string. If
source is empty,
source is returned without
modifications.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
String. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also