Function lcfirst

Source
pub fn lcfirst<S>(str: S) -> String
where S: AsRef<str>,
Expand description

Make a string’s first character lowercase

§Description

Returns a string with the first character of str lowercased 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::lcfirst;

let foo = "HelloWorld";
assert_eq!(lcfirst(foo), "helloWorld");

let bar = "HELLO WORLD!";
assert_eq!(lcfirst(bar), "hELLO WORLD!");