Alistair
Alistair

Reputation: 91

How to remove spaces from mirrored fields in Sublime Text

I am working with snippets in Sublime Text 2/3 and would like to know if there is any way to remove spaces from mirrored fields.

An example:

Variable Description = "$1";
{$1}

Should become the following, if the user were to type in: Dinner Time

Variable Description = "Dinner Time";
{DinnerTime}

Upvotes: 1

Views: 44

Answers (1)

skuroda
skuroda

Reputation: 19744

Haven't done to much with snippets before, but the substitution functionality may get you what you want. Take a look at http://docs.sublimetext.info/en/latest/extensibility/snippets.html#substitutions

If I had to guess though, it would be something like ${1/\s//g}

Upvotes: 2

Related Questions