<commit_before>// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Management.Automation.Host;
using System.Threading;

using Dbg = System.Management.Automation.Diagnostics;

namespace System.Management.Automation.Internal
{
    internal static
    class StringUtil
    {
        internal static
        string
        Format(string formatSpec, object o)
        {
            return string.Format(System.Globalization.CultureInfo.CurrentCulture, formatSpec, o);
        }

        internal static
        string
        Format(string formatSpec, object o1, object o2)
        {
            return string.Format(System.Globalization.CultureInfo.CurrentCulture, formatSpec, o1, o2);
        }

        internal static
        string
        Format(string formatSpec, params object[] o)
        {
            return string.Format(System.Globalization.CultureInfo.CurrentCulture, formatSpec, o);
        }
<commit_msg>Add StringUtil.Format overload to avoid unnecessary allocations (#13408)<commit_after>// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Management.Automation.Host;
using System.Threading;

using Dbg = System.Management.Automation.Diagnostics;

namespace System.Management.Automation.Internal
{
    internal static
    class StringUtil
    {
        internal static string Format(string format, object arg0)
            => string.Format(Globalization.CultureInfo.CurrentCulture, format, arg0);

        internal static string Format(string format, object arg0, object arg1)
            => string.Format(Globalization.CultureInfo.CurrentCulture, format, arg0, arg1);

        internal static string Format(string format, object arg0, object arg1, object arg2)
            => string.Format(Globalization.CultureInfo.CurrentCulture, format, arg0, arg1, arg2);

        internal static string Format(string format, params object[] args)
            => string.Format(Globalization.CultureInfo.CurrentCulture, format, args);

{'fraction_non_alphanumeric': 0.08163265306122448, 'fraction_numerical': 0.010452961672473868, 'mean_word_length': 3.127310061601643, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '525553', 'n_tokens_mistral': 504, 'n_tokens_neox': 496, 'n_words': 140}