[][src]Function phpify::string::ucfirst

pub fn ucfirst<S>(str: S) -> String where
    S: AsRef<str>, 

Make a string's first character uppercase

Description

Returns a string with the first character of str capitalized, if that character is alphabetic.

Note that 'alphabetic' is determined by the current locale. For instance, in the default "C" locale characters such as umlaut-a (ä) will not be converted.

Examples

Example #1 lcfirst() example

use phpify::string::ucfirst;

let foo = "hello world!";
assert_eq!(ucfirst(foo), "Hello world!");