Class StringUtils
Inheritance
System.Object
StringUtils
Assembly: Eco.Core.dll
Syntax
public static class StringUtils : Object
Fields
VersionIdentifier
Declaration
public static string VersionIdentifier
Field Value
| Type |
Description |
| System.String |
|
Methods
AppendSpaceIfSet(LocString)
Declaration
public static LocString AppendSpaceIfSet(this LocString s)
Parameters
Returns
ConcatTogether(Char, String[])
Declaration
public static string ConcatTogether(char joiner, params string[] strings)
Parameters
| Type |
Name |
Description |
| System.Char |
joiner |
|
| System.String[] |
strings |
|
Returns
| Type |
Description |
| System.String |
|
CreateGuidOrNull(String)
Declaration
public static Nullable<Guid> CreateGuidOrNull(string s)
Parameters
| Type |
Name |
Description |
| System.String |
s |
|
Returns
| Type |
Description |
| System.Nullable<System.Guid> |
|
DisplayArea(Int32)
Declaration
public static string DisplayArea(int val)
Parameters
| Type |
Name |
Description |
| System.Int32 |
val |
|
Returns
| Type |
Description |
| System.String |
|
FixCaps(String)
Declaration
public static string FixCaps(this string str)
Parameters
| Type |
Name |
Description |
| System.String |
str |
|
Returns
| Type |
Description |
| System.String |
|
Hours(Single)
Declaration
public static string Hours(this float s)
Parameters
| Type |
Name |
Description |
| System.Single |
s |
|
Returns
| Type |
Description |
| System.String |
|
IfEmpty(String, String)
Declaration
public static string IfEmpty(this string s, string ifEmpty)
Parameters
| Type |
Name |
Description |
| System.String |
s |
|
| System.String |
ifEmpty |
|
Returns
| Type |
Description |
| System.String |
|
IncrementVersion(String)
Declaration
public static string IncrementVersion(string str)
Parameters
| Type |
Name |
Description |
| System.String |
str |
|
Returns
| Type |
Description |
| System.String |
|
IsDigitsOnly(String)
Declaration
public static bool IsDigitsOnly(this string str)
Parameters
| Type |
Name |
Description |
| System.String |
str |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsEmpty(String)
Declaration
public static bool IsEmpty(this string s)
Parameters
| Type |
Name |
Description |
| System.String |
s |
|
Returns
| Type |
Description |
| System.Boolean |
|
JoinSafe(LocString, Nullable<LocString>, String, String)
Postfix will be added at the end of the other if it is set.
For a demo see how AccountsChangeSet.DescribeChange wraps amount description with parenthesis.
Declaration
public static LocString JoinSafe(this LocString s, Nullable<LocString> other, string separator, string postfix = "")
Parameters
| Type |
Name |
Description |
| LocString |
s |
|
| System.Nullable<LocString> |
other |
|
| System.String |
separator |
|
| System.String |
postfix |
|
Returns
Pluralize(LocString, Int32)
Declaration
public static LocString Pluralize(this LocString word, int count = 2)
Parameters
| Type |
Name |
Description |
| LocString |
word |
|
| System.Int32 |
count |
|
Returns
Pluralize(String, Int32)
Declaration
public static string Pluralize(this string word, int count = 2)
Parameters
| Type |
Name |
Description |
| System.String |
word |
|
| System.Int32 |
count |
|
Returns
| Type |
Description |
| System.String |
|
PluralizeLoc(String, Single)
Declaration
public static string PluralizeLoc(this string word, float count)
Parameters
| Type |
Name |
Description |
| System.String |
word |
|
| System.Single |
count |
|
Returns
| Type |
Description |
| System.String |
|
PluralizeNum(LocString, Int32)
Declaration
public static LocString PluralizeNum(this LocString word, int count = 2)
Parameters
| Type |
Name |
Description |
| LocString |
word |
|
| System.Int32 |
count |
|
Returns
PluralizeNum(String, Int32)
Declaration
public static string PluralizeNum(this string word, int count = 2)
Parameters
| Type |
Name |
Description |
| System.String |
word |
|
| System.Int32 |
count |
|
Returns
| Type |
Description |
| System.String |
|
PrependNewlineIfNeeded(String)
Declaration
public static string PrependNewlineIfNeeded(this string text)
Parameters
| Type |
Name |
Description |
| System.String |
text |
|
Returns
| Type |
Description |
| System.String |
|
RandomString(Int32)
Declaration
public static string RandomString(int length)
Parameters
| Type |
Name |
Description |
| System.Int32 |
length |
|
Returns
| Type |
Description |
| System.String |
|
RemoveWhitespace(String)
Declaration
public static string RemoveWhitespace(this string input)
Parameters
| Type |
Name |
Description |
| System.String |
input |
|
Returns
| Type |
Description |
| System.String |
|
ShortName(String, Func<String, Boolean>)
Declaration
public static string ShortName(string name, Func<string, bool> exists)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| System.Func<System.String, System.Boolean> |
exists |
|
Returns
| Type |
Description |
| System.String |
|
Spaces(Int32)
Declaration
public static string Spaces(int count)
Parameters
| Type |
Name |
Description |
| System.Int32 |
count |
|
Returns
| Type |
Description |
| System.String |
|
SplitAtIndex(String, Int32)
Declaration
public static (string, string) SplitAtIndex(this string s, int index)
Parameters
| Type |
Name |
Description |
| System.String |
s |
|
| System.Int32 |
index |
|
Returns
| Type |
Description |
| System.ValueTuple<System.String, System.String> |
|
SplitIntoNameAndNumber(String)
Declaration
public static (string, int) SplitIntoNameAndNumber(string str)
Parameters
| Type |
Name |
Description |
| System.String |
str |
|
Returns
| Type |
Description |
| System.ValueTuple<System.String, System.Int32> |
|
TrailingVersion(String)
Declaration
public static string TrailingVersion(this string str)
Parameters
| Type |
Name |
Description |
| System.String |
str |
|
Returns
| Type |
Description |
| System.String |
|
TryRemoveFromEnd(String, String, out String)
If the specified string is used at the end of the current string, we return the new string without that part else we just return false.
Declaration
public static bool TryRemoveFromEnd(this string s, string stringToRemove, out string newString)
Parameters
| Type |
Name |
Description |
| System.String |
s |
|
| System.String |
stringToRemove |
|
| System.String |
newString |
|
Returns
| Type |
Description |
| System.Boolean |
|
UniqueKey(IDictionary, String)
Declaration
public static string UniqueKey(this IDictionary existing, string root)
Parameters
| Type |
Name |
Description |
| System.Collections.IDictionary |
existing |
|
| System.String |
root |
|
Returns
| Type |
Description |
| System.String |
|