private StringBuilder AppendWithSep(string s, StringBuilder b) { if (b.Length == 0) { b.Append(s); } else { SimpleFormatterImpl.FormatAndReplace(separatorFormat, b, null, b.AsCharSequence(), s.AsCharSequence()); } return(b); }
// ICU4N specific - FormatAndReplace( // StringBuilder result, int[] offsets, params ICharSequence[] values) moved to SimpleFormatterExtension.tt /// <summary> /// Formats the given values, replacing the contents of the result builder. /// May optimize by actually appending to the result if it is the same object /// as the value corresponding to the initial argument in the pattern. /// </summary> /// <param name="result">Gets its contents replaced by the formatted pattern and values.</param> /// <param name="offsets"> /// offsets[i] receives the offset of where /// values[i] replaced pattern argument {i}. /// Can be null, or can be shorter or longer than values. /// If there is no {i} in the pattern, then offsets[i] is set to -1. /// </param> /// <returns><paramref name="result"/></returns> /// <stable>ICU4N 60.1</stable> public StringBuilder FormatAndReplace( StringBuilder result, int[] offsets) // ICU4N specific overload to avoid ambiguity when no params are passed { return(SimpleFormatterImpl.FormatAndReplace(compiledPattern, result, offsets, new ICharSequence[0])); }
/// <summary> /// Formats the given values, replacing the contents of the result builder. /// May optimize by actually appending to the result if it is the same object /// as the value corresponding to the initial argument in the pattern. /// </summary> /// <param name="result">Gets its contents replaced by the formatted pattern and values.</param> /// <param name="offsets"> /// offsets[i] receives the offset of where /// values[i] replaced pattern argument {i}. /// Can be null, or can be shorter or longer than values. /// If there is no {i} in the pattern, then offsets[i] is set to -1. /// </param> /// <param name="values"> /// The argument values. /// An argument value may be the same object as result. /// values.Length must be at least <see cref="ArgumentLimit"/>. /// </param> /// <returns><paramref name="result"/></returns> /// <stable>ICU 57</stable> internal StringBuilder FormatAndReplace( StringBuilder result, int[] offsets, params ICharSequence[] values) { return(SimpleFormatterImpl.FormatAndReplace(compiledPattern, result, offsets, values)); }
public StringBuilder FormatAndReplace( StringBuilder result, int[] offsets, params char[][] values) { return(SimpleFormatterImpl.FormatAndReplace(compiledPattern, result, offsets, values)); }