コード例 #1
0
        public void Clean_WithAccentsInString_StripsAccentsOut()
        {
            string valToTest = "AKéSJDGHASDé";
            string expected  = "akesjdghasde";
            var    actual    = cleaner.Clean(valToTest);

            Console.WriteLine(String.Format("Accented LowerCaseNormalize clean result = {0}", actual));
            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public string Clean(string value)
        {
            // do basic cleaning
            value = _sub.Clean(value);
            if (String.IsNullOrEmpty(value))
            {
                return("");
            }

            // do our stuff
            if (value.StartsWith("the "))
            {
                value = value.Substring(4);
            }

            return(value);
        }
コード例 #3
0
        public string Clean(string value)
        {
            // do basic cleaning
            value = _sub.Clean(value);
            if (String.IsNullOrEmpty(value))
            {
                return("");
            }

            // do our stuff
            int ix = value.IndexOf(',');

            if (ix != -1)
            {
                value = value.Substring(0, ix);
            }

            return(value);
        }