How can I remove the dot that starts a string?
$string = ". Hello world .";
I only want to remove the first dot, not the dot at the end.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Simple pattern would match any period (or sequence, since you suggested this) at the start of a string, or (following a request from the OP in the comments below) at the end of the string:
Demo: http://codepad.org/Nst5EX1k