Table of Contents
Extensions for strings
public static class StringExt
Inheritance System.Object StringExt
Gets the localization from the current localization text table, or the default one if it's not present in the current one.
If the id is not present in any of these, returned as spaced or not spaced depending on parameters.
public static string GetBtd6Localization(this string id, bool returnAsSpacedIfNoEntry=true);
The ID of the thing you're trying to get the localization of.
returnAsSpacedIfNoEntry
System.Boolean
Should this return the id with spaces if there's no localization present?
Gets the localization from the current localization text table, or the default one if it's not present in the current one.
If the id is not present in any of these, returned as spaced or not spaced depending on parameters.
public static string Localize(this string id);
The ID of the thing you're trying to get the localization of.
Returns null if a string is empty / whitespace, otherwise just returns back the string
public static string NullIfEmpty(this string s);
public static string RegexReplace(this string input, string pattern, string replacement);
input
System.String
pattern
System.String
replacement
System.String
Puts spaces between capitalized words within a string
public static string Spaced(this string s);
Splits the string on spaces, but preserves strings of words with spaces if surround by quotes
public static string[] SplitRespectingQuotes(this string input);
input
System.String
public static string ToTitleCase(this string input);
input
System.String