.net - split string before hyphen - asp.net c# -
i have string :
10989898 - test1
or example:
123178239182 - test2
i need output this:
in first case:
10989898
in second case:
123178239182
means value before hyphen. how can that?
string result = thestring.substring(0, thestring.indexof("-")).trim();
Comments
Post a Comment