/ /

XtScript Function: lcfirst and ucfirst

Make a string's first character lowercase, or uppercase.

XtScript's lcfirst is a function that will process a string to change the first character found in the string to lowercase and return the result.

Meanwhile the opposed ucfirst is an XtScript function that will change the first character found in the string to uppercase and return the result.

Learn XtScript lcfirst and ucfirst function from examples

Change first character in a string to lowercase using lcfirst function, or change first character in a string to uppercase using ucfirst function.

- Code:
<!--parser:xtscript-->
var $string_1 = SOMEWHERE OVER
var $lower_first = call lcfirst $val=$string_1

var $string_2 = beautiful rainbow
var $upper_first = call ucfirst $val=$string_2

print String 1: $string_1 <br/>
print After lcfirst: $lower_first <br/><br/>

print String 2: $string_2 <br/>
print After ucfirst: $upper_first
<!--/parser:xtscript-->
- Result:
String 1: SOMEWHERE OVER
After lcfirst: sOMEWHERE OVER

String 2: beautiful rainbow
After ucfirst: Beautiful rainbow

Ring ring