c# - how to prevent two similar charactors occur together anywhere in a string -


i want prevent 2 similar characters example "@" occur anywhere in string. how can .this string:

    static string email = " example@gmail.com"; 

in case of answer of moo-juice, can use linq in counof extension method:

public static class extensions {     public static int countof(this string data, char c)     {         return string.isnullorempty(data) ? 0 : data.count(chk => chk == c);     } } 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -