AcTools.Utils.Helpers.FlexibleParser.ReplaceDouble C# (CSharp) 메소드

ReplaceDouble() 개인적인 메소드

private ReplaceDouble ( [ s, double value ) : string
s [
value double
리턴 string
        public static string ReplaceDouble([CanBeNull] string s, double value) {
            if (s == null) {
                return null;
            }

            if (_parseDouble == null) {
                _parseDouble = new Regex(@"-? *\d+([\.,]\d*)?");
            }

            var match = _parseDouble.Match(s);
            if (!match.Success) return s;

            return s.Substring(0, match.Index) + value.ToString(CultureInfo.InvariantCulture) +
                   s.Substring(match.Index + match.Length);
        }