Using Regular Expression Visual Stdio

Replace:
public string StrMetodoPago
{
get { return strMetodoPago; }
set { strMetodoPago = value; }
}
For this:
public string StrMetodoPago
{
get { return string.IsNullOrEmpty(strMetodoPago) ? string.Empty : strMetodoPago; }
set { strMetodoPago = value; }
}

Search Expression:
get.\{.[return]+.{[a-zA-Z0-9]+};.\}

Replace Expression:
get { return string.IsNullOrEmpty(\1) ? string.Empty : \1; }

Advertisements

One Comment

  1. Replace this:
    get { return string.IsNullOrEmpty(strImpuesto) ? string.Empty : strImpuesto; }

    to this;
    get { return string.IsNullOrEmpty(strImpuesto) ? string.Empty : TootleFramework.Utilerias.formatoTexto(strImpuesto); }

    Search:
    get.*\({([a-zA-Z]+)}\).*\:.*{([a-zA-Z]+)};.*
    Replace:
    get { return string.IsNullOrEmpty(\1) ? string.Empty : TootleFramework.Utilerias.formatoTexto(\1); }

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s