• + 0 comments

    in C#

    public static int camelcase(string s)
        {
           List<string> totalwords = new List<string>();
           string _singleword ="";
            for(int i=0; i < s.Length; i++){
                if(!char.IsUpper(s[i])){
                    _singleword += s[i];
                }
                else
                {
                    totalwords.Add(_singleword);
                    _singleword = "";
                    _singleword += s[i];
                }
             }
             return totalwords.Count+1;
        }