GetExtra() public method

public GetExtra ( string field ) : string
field string
return string
Example #1
0
        public static string DoReplaceForExtraValueCode(string text, Person p)
        {
            const string RE = @"{ev:(?<name>.+?)}";

            var re    = new Regex(RE, RegexOptions.Singleline | RegexOptions.Multiline);
            var match = re.Match(text);

            while (match.Success)
            {
                var tag  = match.Value;
                var name = match.Groups["name"].Value;

                if (p == null)
                {
                    text = text.Replace(tag, "");
                }
                else
                {
                    text = text.Replace(tag, p.GetExtra(name));
                }

                match = match.NextMatch();
            }
            return(text);
        }
Example #2
0
        public static string DoReplaceForExtraValueCode(string text, Person p)
        {
            const string RE = @"{ev:(?<name>.+?)}";

            var re = new Regex(RE, RegexOptions.Singleline | RegexOptions.Multiline);
            var match = re.Match(text);
            while (match.Success)
            {
                var tag = match.Value;
                var name = match.Groups["name"].Value;

                if (p == null)
                    text = text.Replace(tag, "");
                else
                    text = text.Replace(tag, p.GetExtra(name));
                match = match.NextMatch();
            }
            return text;
        }