using System;
using System.Linq;
using System.Text.RegularExpressions;

namespace CSharpHelperMethods {
    public class CSharpHelperMethods {
    
        /// <summary>
        /// 
        /// </summary>
        public string FirstLetterUpperCase(string str) {
            return str.First().ToString().ToUpper() + str.Substring(1);
        }

        /// <summary>
        /// 
        /// </summary>
        public string CamelCase() {
            //todo
            return "";
        }

        /// <summary>
        /// 
        /// </summary>
        //this is obviously not super-safe but convenient enough for now
        private int CountStrOccurence(String term, String str) {
            str = Regex.Replace(str, "@" + String.Format("\b{0}\b", "a"), "~");
            return str.Count(f => f == '~');
        }

        /// <summary>
        /// Convert special characters to their 'normal' equivalents. E.g. ä becomes a
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        private String DecodeSpecialCharacters(String input) {
            byte[] tempBytes;
            tempBytes = System.Text.Encoding.GetEncoding("ISO-8859-8").GetBytes(input);
            return System.Text.Encoding.UTF8.GetString(tempBytes);
        }
    }
}
