I have the following String
“Sample”
however in some occurences there may be one or more spaces in the beginning:
” Sample” or ” Sample”
Without using trim, what regular expression can I use to match if there is one? I am using (\s+) for the current String. I want the space to be included as part of the same one group.
You don’t need regular expressions:
But if you want regex: