ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I have a string such as "helLo wOrlD". I'd like to transform this into "Hello World", ie. capitalise the first letter of every word, and transform the rest into small letters, both being compulsory.
How do I do it?
You know I find it quite funny that search engines only work on certain continents, in certain states and even sometimes as close as a few suburbs away (as has been my experience). Personally I have yet to come across one of these magical places that allows me to frequent all site on the internet except any of the search engines, even to the point where I go to a site with a search engine built in (say www.linuxquestions.org) and for the life of me I can't access it either.
Oh no particular reason, I've just done this sort of thing before in Perl, and there I used regex's, so I was looking to go the same way here.... , but the solutions suggested above will do just fine!
Oh no particular reason, I've just done this sort of thing before in Perl, and there I used regex's, so I was looking to go the same way here.... , but the solutions suggested above will do just fine!
PHP isn't Perl, so things are done a bit differently.
PHP isn't Perl, so things are done a bit differently.
yeah it isn't, nonetheless it includes above mentioned functions (and couple more) to run regex stuff.
preg stands for, iirc, "perl regular" [expressions]
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.