Ejemplo n.º 1
0
        public void Feed(string rawText)
        {
            string[] rawFieldData = rawText.Split(_delimterInfo.Delimiters, StringSplitOptions.None);
            string[] fieldData    = rawFieldData;

            // Check char map / text qualifier
            Dictionary <string, string> charMap = _delimterInfo.MarkMap;

            if (_delimterInfo.TextQualifier != null)
            {
                charMap.Add(_delimterInfo.TextQualifier.ToString(), string.Empty);
            }

            if (charMap.Count > 0)
            {
                fieldData = new string[rawFieldData.Length];
                for (int ind = 0; ind < rawFieldData.Length; ind++)
                {
                    fieldData[ind] = RegexPro.ReplaceMultiple(rawFieldData[ind], charMap);
                }
            }

            if (_callback != null)
            {
                _callback(fieldData);
            }
        }
Ejemplo n.º 2
0
        public void TestRegex()
        {
            string name = "Zhou, Feng";
            string fl   = RegexPro.ToFirstNameLastName(name);
            string lf   = RegexPro.ToLastNameFirstName(fl);

            Assert.IsTrue(name == lf);
        }