c# 4.0 - How to remove colon's from a string with in C#? -
i have string "alta homeowner's policy of title insurance". want remove colon above string(which 1 beside home owner)? how using c#
one way finding index of colon , using remove method available string object.
int index; string s = "alta homeowner's policy of title insurance"; string output; index = s.indexof('\''); if (index != -1) { output = s.remove(index, 1); console.out.writeline(output); } escape character '\' used catch colon.
indexof method return index of first occurance of matching character. other methods indexofany,lastindexof available.
Comments
Post a Comment