Replace recursively
Posted: Sat Feb 02, 2008 7:57 am
Hi!
I have a lot of variables, and I would like to make a Get function for each. E.g.:
from:
to:
the problem is that the int is not constant, it could be any other type.
I tried with this:
This matches the string, but makes a replacement only for var2.
I have a lot of variables, and I would like to make a Get function for each. E.g.:
from:
Code: Select all
int var1, var2;Code: Select all
public int Getvar1()
{
return this.var1;
}
public int Getvar2()
{
return this.var2;
}I tried with this:
Code: Select all
[\s]*([\w]+)(?:[ ]([\w]+),?)+;