Capitalize only the first letter after the first dash
How to convert only the first letter to uppercase after the first dash separator?
Example:
From: any text - any. any text - any text
any text - ANY. ANY Text - ANY TEXT
To: any text - Any. any text - any text
Example:
From: any text - any. any text - any text
any text - ANY. ANY Text - ANY TEXT
To: any text - Any. any text - any text
Easy - when you know how!
Use a Replace method with a regular expression. The trick is to use \Ux and \Lx instead of \x in the replacement string. These return the xth captured group converted to upper and lower case respectively. This is not included in the basic introduction to regex in the User Guide but see www.regular-expressions.info/refreplacecase.html for more details.
So...
Replace: (- *\w)(.*)
with: \U1\L2
Use regular expressions
Use a Replace method with a regular expression. The trick is to use \Ux and \Lx instead of \x in the replacement string. These return the xth captured group converted to upper and lower case respectively. This is not included in the basic introduction to regex in the User Guide but see www.regular-expressions.info/refreplacecase.html for more details.
So...
Replace: (- *\w)(.*)
with: \U1\L2
Use regular expressions
Reply to #2:
Thank you David. The solution working also in Notepad++.
Replace with: $1\U$2\L
Thank you David. The solution working also in Notepad++.
Replace with: $1\U$2\L