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

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -