Any code generator that takes some strings and append/prepend characters?

I've got a column of string values copied over from a text file, each value on a new line like so:

PHP
Java
C#
Swift
Go
...

I need to get it like so:

new TechnologySeed("PHP"),
new TechnologySeed("Java"),
new TechnologySeed("C#"),
new TechnologySeed("Swift"),
new TechnologySeed("Go"),

I know I can use alt-click to have multi-carets and then start typing the surroundings. But this quickly becomes unscalable when I have hundreds of these values.

I'm wondering if there's already an in-built way to do this a la the genius that is Live Templates. Like a template that takes in an array of values and spits out that output I want. Is there?

Else, what is my best recourse? Using find-replace using regex?

1 comment
Avatar
Vladimir Luchansky
Comment actions Permalink

Hello,

> I'm wondering if there's already an in-built way to do this a la the genius that is Live Templates. Like a template that takes in an array of values and spits out that output I want. Is there?

> Else, what is my best recourse? Using find-replace using regex?

There is no existing live template for this. Find-replace with regexp is the best way, I think.

0

Please sign in to leave a comment.