We can use the lcfirst function if people are supposed to enter a username/ID like a1234 or aBCDE but rather type it as A1234 or ABCDE. Or it can be useful in other languages, such as Xhosa, where the second letter in a word is sometimes in upper case while the first letter is in lowercase. This is of course very annoying when it comes to autocorrect. How do you capitalise the first letter in every string except the word "a" and only where "a" is not the first word in the sentence?
Log in to save your progress and obtain a certificate in Alison’s free Fundamentals of Perl Programming online course
Sign up to save your progress and obtain a certificate in Alison’s free Fundamentals of Perl Programming online course
Please enter you email address and we will mail you a link to reset your password.