<commit_before>﻿namespace isukces.code
{
    public static class StringExtensions
    {
        public static string Capitalize(this string x)
        {
            return x.Substring(0, 1).ToUpper() + x.Substring(1);
        }
 
        /// <summary>
        ///     Koduje string do postaci stałej C#
        /// </summary>
        /// <param name="x"></param>
        /// <returns></returns>
        public static string CsEncode(this string x)
        {
            const string quote = "\"";
            const string backslash = "\\";

            return quote + x
                       .Replace(backslash, backslash + backslash)
                       .Replace("\r", backslash + "r")
                       .Replace("\n", backslash + "n")
                       .Replace("\t", backslash + "t")
                       .Replace(quote, backslash + quote) + quote;
        }

        public static string UnCapitalize(this string x)
        {
            return x.Substring(0, 1).ToLower() + x.Substring(1);
        }
        
        public static string FirstLower(this string name) // !!!!!!
        {
            return name.Substring(0, 1).ToLower() + name.Substring(1);
        }


        public static string FirstUpper(this string name)
        {
            return name.Substring(0, 1).ToUpper() + name.Substring(1);
        }

    }
}<commit_msg>Verbatim string encode<commit_after>﻿using System.Text;

namespace isukces.code
{
    public static class StringExtensions
    {
        public static string Capitalize(this string x)
        {
            return x.Substring(0, 1).ToUpper() + x.Substring(1);
        }
 
        /// <summary>
        ///     Koduje string do postaci stałej C#
        /// </summary>
        /// <param name="x"></param>
        /// <returns></returns>
        public static string CsEncode(this string x)
        {
            const string quote = "\"";
            const string backslash = "\\";
            if (x is null)
                return "null";
            return quote + x
                       .Replace(backslash, backslash + backslash)
                       .Replace("\r", backslash + "r")
                       .Replace("\n", backslash + "n")
                       .Replace("\t", backslash + "t")
                       .Replace(quote, backslash + quote) + quote;
        }
        
        /// <summary>
        ///     Koduje string do postaci stałej C#
        /// </summary>
        /// <param name="x"></param>
        /// <returns></returns>
        public static string CsVerbatimEncode(this string x)
        {
            if (x is null)
                return "null";

            const string quote     = "\"";
            const string backslash = "\\";
            var sb = new StringBuilder();
            sb.Append("@");
            sb.Append(quote);
            foreach (var c in x)
            {
                if (c == '\"')
                    sb.Append(quote + quote);
                else
                    sb.Append(c);
            }

            sb.Append(quote);
            return sb.ToString();
        }

        public static string UnCapitalize(this string x)
        {
            return x.Substring(0, 1).ToLower() + x.Substring(1);
        }
        
        public static string FirstLower(this string name) // !!!!!!
        {
            return name.Substring(0, 1).ToLower() + name.Substring(1);
        }


        public static string FirstUpper(this string name)
        {
            return name.Substring(0, 1).ToUpper() + name.Substring(1);
        }

    }
}
{'fraction_non_alphanumeric': 0.12738496071829405, 'fraction_numerical': 0.006734006734006734, 'mean_word_length': 1.295556986477785, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '1679767', 'n_tokens_mistral': 980, 'n_tokens_neox': 929, 'n_words': 235}