Monday 25 April 2011

Retrieve data after hypen

Suppose you have a string separated by hypen("-").If you want only the portion which comes after hypen("-") then you have to write


public static String getID(String value)
{
          return value.Split('-')[value.Split('-').Length - 1].Trim();
}

0 comments:

Post a Comment