<commit_before>using System;
using System.Text;
using System.Collections;

namespace NHibernate.Util {
	
	public sealed class StringHelper {
		
		public const string EmptyString = "";
		public const char Dot = '.';
		public const char Underscore = '_';
		public const string CommaSpace = ", ";
		public const string Comma = ",";
		public const string OpenParen = "(";
		public const string ClosedParen = ")";

		public static string Join(string seperator, string[] strings) {
			int length = strings.Length;
			if (length == 0)
				return EmptyString;
			StringBuilder buf = new StringBuilder( length * strings[0].Length )
				.Append(strings[0]);
			for (int i=1; i<length; i++) {
				buf.Append(seperator).Append(strings[i]);
			}
			return buf.ToString();
		}

		public static string Repeat(string str, int times) {
			StringBuilder buf = new StringBuilder(str.Length * times);
			for (int i=0; i<times; i++)
				buf.Append(str);
			return buf.ToString();
		}

		public static string Replace(string template, string placeholder, string replacement) {
			int loc = template.IndexOf(placeholder);
			if (loc<0) {
				return template;
			} else {
				return new StringBuilder( template.Substring(0, loc) )
					.Append(replacement)
					.Append( Replace(
					template.Substring( loc + placeholder.Length ),
					placeholder,
					replacement
					) ).ToString();
			}
		}

		public static string ReplaceOnce(string template, string placeholder, string replacement) {
			int loc = template.IndexOf(placeholder);
			if (loc < 0) {
				return template;<commit_msg>My first contribution. Simplified StringHelper.Join().<commit_after>using System;
using System.Text;
using System.Collections;

namespace NHibernate.Util {
	
	public sealed class StringHelper {
		
		public const string EmptyString = "";
		public const char Dot = '.';
		public const char Underscore = '_';
		public const string CommaSpace = ", ";
		public const string Comma = ",";
		public const string OpenParen = "(";
		public const string ClosedParen = ")";

		[Obsolete("Use String.Join() instead of this method. It does the same thing")]
		public static string Join(string separator, string[] strings) {
			return String.Join(separator, strings);
		}

		public static string Repeat(string str, int times) {
			StringBuilder buf = new StringBuilder(str.Length * times);
			for (int i=0; i<times; i++)
				buf.Append(str);
			return buf.ToString();
		}

		public static string Replace(string template, string placeholder, string replacement) {
			int loc = template.IndexOf(placeholder);
			if (loc<0) {
				return template;
			} else {
				return new StringBuilder( template.Substring(0, loc) )
					.Append(replacement)
					.Append( Replace(
					template.Substring( loc + placeholder.Length ),
					placeholder,
					replacement
					) ).ToString();
			}
		}

		public static string ReplaceOnce(string template, string placeholder, string replacement) {
			int loc = template.IndexOf(placeholder);
			if (loc < 0) {
				return template;
{'fraction_non_alphanumeric': 0.11244178310046574, 'fraction_numerical': 0.003992015968063872, 'mean_word_length': 3.5978593272171255, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 3, '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': '2997553', 'n_tokens_mistral': 1036, 'n_tokens_neox': 836, 'n_words': 270}