I have some files with names starting with core-
and following one or more words separated by hyphen, like this:
core-query
core-query-pagination
core-query-pagination-numbers
I’m creating a VS Code Snippet to transform the file name to get this result:
QUERY
QUERY PAGINATION
QUERY PAGINATION NUMBERS
- Remove
core-
- Replace
-
with - Capitalize every word
What I’ve got so far is this:
"${TM_FILENAME_BASE/([^-]+)(-*)/${1:/capitalize}${2:+ }/g}"
Output:
Core Query Pagination Numbers
New contributor
Germán Freixinós is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.