SandboxSystemExtensionsclass

objectSandboxSystemExtensions
Namespace
Sandbox
Assembly
Sandbox.System
Declaration
public static abstract sealed class Sandbox.SandboxSystemExtensions

Methods122

Showing 122 methods

public static Angles Angles(System.Random self)PUBLICSTATIC

Returns the angles of a uniformly random rotation.

ParameterTypeDescription
selfRandom
Returns:Angles

public static int AsInt(T value)PUBLICSTATIC

ParameterTypeDescription
valueT
Returns:int

public static string Base64Decode(string base64EncodedData)PUBLICSTATIC

Convert from a base64 encoded string

ParameterTypeDescription
base64EncodedDatastring
Returns:string

public static string Base64Encode(string plainText)PUBLICSTATIC

Convert to a base64 encoded string

ParameterTypeDescription
plainTextstring
Returns:string

public static int BitsSet(int i)PUBLICSTATIC

Returns the number of bits set in an integer. This us usually used for flags to count the amount of flags set.

ParameterTypeDescription
iint
Returns:int

public static System.Collections.Generic.IEnumerable`1<Vector3> CatmullRomSpline(System.Collections.Generic.IEnumerable`1<Vector3> points, int interpolation)PUBLICSTATIC

ParameterTypeDescription
pointsIEnumerable<Vector3>
interpolationint
Returns:IEnumerable<Vector3>

public static bool CheckValidationAttributes(System.Reflection.PropertyInfo prop, object obj, string[] errors, string name = null)PUBLICSTATIC

Check all `System.ComponentModel.DataAnnotations.ValidationAttribute`s on this property, and get the error messages if there are any.

ParameterTypeDescription
propPropertyInfoThe property whose arguments to test.
objobjectInstance of the object this property is of.
errorsstring[]If returned false, these will be the error messages to display.
name = nullstringOverride the property name in error messages.
Returns:boolReturns true if all checks have passed or there is no attributes to test, false if there were errors.

public static T Clamp(T input, T min, T max)PUBLICSTATIC

Clamp a number between two values.

ParameterTypeDescription
inputT
minT
maxT
Returns:T

public static System.Collections.Generic.Dictionary`2<TKey,TValue> Clone(System.Collections.Generic.Dictionary`2<TKey,TValue> dict)PUBLICSTATIC

ParameterTypeDescription
dictDictionary<TKey,TValue>
Returns:Dictionary<TKey,TValue>

public static string CollapseSpacesAndPreserveLines(string str)PUBLICSTATIC

Collapse sequences of spaces and tabs into a single space, preserving newlines

ParameterTypeDescription
strstring
Returns:string

public static string CollapseWhiteSpace(string str)PUBLICSTATIC

Collapse sequences of whitespace into a single whitespace

ParameterTypeDescription
strstring
Returns:string

public static Color Color(System.Random self)PUBLICSTATIC

Returns a random Color

ParameterTypeDescription
selfRandom
Returns:Color

public static string Columnize(string str, int maxLength, bool right = False)PUBLICSTATIC

convert "string" into "string " or " string"

ParameterTypeDescription
strstring
maxLengthint
right = Falsebool
Returns:string

public static int Distance(string source, string target)PUBLICSTATIC

Return the distance between two strings. Useful for ordering strings by similarity

ParameterTypeDescription
sourcestring
targetstring
Returns:int

public static int FastHash(string str)PUBLICSTATIC

Generate a 32-bit truncated xxhash3 hash from given string.

ParameterTypeDescription
strstring
Returns:int

public static ulong FastHash64(string str)PUBLICSTATIC

Generate a 64-bit xxhash3 hash from given string.

ParameterTypeDescription
strstring
Returns:ulong

public static float FloatDeterministic(System.Random self, int i)PUBLICSTATIC

Get a random float (0-1) from a pre-calculated list. This is faster, and if you put the same seed in, it will always return the same number. The downside is that it only has 8192 variations of floats, but that seem like enough for most things.

ParameterTypeDescription
selfRandom
iint
Returns:float

public static System.Threading.Tasks.Task ForEachTaskAsync(System.Collections.Generic.IEnumerable`1<T> source, System.Func`2<T,System.Threading.Tasks.Task> body, int maxRunning = 8, System.Threading.CancellationToken token = null)PUBLICSTATIC

ParameterTypeDescription
sourceIEnumerable<T>
bodyFunc<T,Task>
maxRunning = 8int
token = nullCancellationToken
Returns:Task

public static string FormatBytes(T input, bool shortFormat = False)PUBLICSTATIC

Given a number, will format as a memory value, ie 10gb, 4mb

ParameterTypeDescription
inputT
shortFormat = Falsebool
Returns:string

public static string FormatWithSuffix(int num)PUBLICSTATIC

Change 1 to 1st, 2 to 2nd etc

ParameterTypeDescription
numint
Returns:string

public static T FromArray(System.Random self, T[] array, T defVal = null)PUBLICSTATIC

Returns a random value in an array

ParameterTypeDescription
selfRandom
arrayT[]
defVal = nullT
Returns:T

public static long FromBase36(string input)PUBLICSTATIC

Decode the Base36 Encoded string into a number

ParameterTypeDescription
inputstring
Returns:long

public static T FromList(System.Random self, System.Collections.Generic.List`1<T> array, T defVal = null)PUBLICSTATIC

ParameterTypeDescription
selfRandom
arrayList<T>
defVal = nullT
Returns:T

public static float Gaussian(System.Random self, float mean = 0, float stdDev = 1)PUBLICSTATIC

Sample from a Gaussian distribution with a given mean and standard deviation.

ParameterTypeDescription
selfRandom
mean = 0float
stdDev = 1float
Returns:float

public static Vector2 Gaussian2D(System.Random self, System.Nullable`1<Vector2> mean = null, System.Nullable`1<Vector2> stdDev = null)PUBLICSTATIC

ParameterTypeDescription
selfRandom
mean = nullNullable<Vector2>
stdDev = nullNullable<Vector2>
Returns:Vector2

public static Vector3 Gaussian3D(System.Random self, System.Nullable`1<Vector3> mean = null, System.Nullable`1<Vector3> stdDev = null)PUBLICSTATIC

ParameterTypeDescription
selfRandom
mean = nullNullable<Vector3>
stdDev = nullNullable<Vector3>
Returns:Vector3

public static Vector4 Gaussian4D(System.Random self, System.Nullable`1<Vector4> mean = null, System.Nullable`1<Vector4> stdDev = null)PUBLICSTATIC

ParameterTypeDescription
selfRandom
mean = nullNullable<Vector4>
stdDev = nullNullable<Vector4>
Returns:Vector4

public static T GetAttributeOfType(System.Enum enumVal)PUBLICSTATIC

Gets an attribute on an enum field value

ParameterTypeDescription
enumValEnumThe enum value
Returns:TThe attribute of type T that exists on the enum value

Example

Built-in examples define the default contract and should be read first.

public static System.Type GetCommonBaseType(System.Collections.Generic.IEnumerable`1<System.Type> types)PUBLICSTATIC

ParameterTypeDescription
typesIEnumerable<Type>
Returns:Type

public static int GetEpoch(System.DateTime d)PUBLICSTATIC

Returns the UNIX time stamp - number of seconds since 1st of January, 1970.

ParameterTypeDescription
dDateTime
Returns:int

public static string GetFilenameSafe(string input)PUBLICSTATIC

Make the passed in string filename safe. This replaces any invalid characters with "_".

ParameterTypeDescription
inputstring
Returns:string

public static int GetManagedSize(System.Type t)PUBLICSTATIC

Get the managed size of a given type. This matches an IL-level sizeof(t), even if it cannot be determined normally in C#. Note that `sizeof(t) != Marshal.SizeOf(t)` when t is char or bool.

Note

An IL-level `sizeof(t)` will return `sizeof(IntPtr)` for reference types, as it refers to the size on stack or in an object, not the size on heap.

ParameterTypeDescription
tType
Returns:int

public static TValue GetOrCreate(System.Collections.Generic.IDictionary`2<TKey,TValue> dict, TKey key)PUBLICSTATIC

ParameterTypeDescription
dictIDictionary<TKey,TValue>
keyTKey
Returns:TValue

public static T GetPropertyValue(System.Text.Json.Nodes.JsonObject jso, string membername, T defaultvalue)PUBLICSTATIC

Get a property value by name, from a JsonObject. Return defaultValue if it's not found.

ParameterTypeDescription
jsoJsonObject
membernamestring
defaultvalueT
Returns:T

public static string HtmlEncode(string str)PUBLICSTATIC

ParameterTypeDescription
strstring
Returns:string

public static bool IsBasedOnGenericType(System.Type src, System.Type test)PUBLICSTATIC

Returns if this type is based on a given generic type.

ParameterTypeDescription
srcTypeThe type to test.
testTypeThe type to test against. Typically this will be something like typeof( MyType<> )
Returns:bool

public static bool IsInitOnly(System.Reflection.PropertyInfo property)PUBLICSTATIC

Determine if this property is init-only.

ParameterTypeDescription
propertyPropertyInfoThe property to test.
Returns:boolReturns true if the property is init-only, false otherwise.

public static bool IsPowerOfTwo(int x)PUBLICSTATIC

Return true if the number is a power of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, etc)

ParameterTypeDescription
xint
Returns:bool

public static bool IsValid(Sandbox.IValid obj)PUBLICSTATIC

Returns false if `Sandbox.IValid` object is null or if `Sandbox.IValid.IsValid` returns false.

ParameterTypeDescription
objIValid
Returns:bool

public static bool IsValidTag(string source)PUBLICSTATIC

Is this string a valid Tag. This is a way to check if a string is a valid tag, project wide. So our logic is always the same. - not null - between 1 and 32 chars - a-z

ParameterTypeDescription
sourcestring
Returns:bool

public static string Md5(string input)PUBLICSTATIC

Get the md5 hash of a string.

ParameterTypeDescription
inputstring
Returns:string

public static string Plural(int a, string single, string plural)PUBLICSTATIC

Return single if 1 else plural

ParameterTypeDescription
aint
singlestring
pluralstring
Returns:string

public static string QuoteSafe(string str, bool optional = False)PUBLICSTATIC

Puts quote marks around a string. Internal quotes are backslashed.

ParameterTypeDescription
strstring
optional = Falsebool
Returns:string

public static string ReadNullTerminatedString(System.IO.Stream stream, long offset)PUBLICSTATIC

Read a null terminated string from the stream, at given offset.

ParameterTypeDescription
streamStreamThe stream to read from.
offsetlongOffset where to start reading, from the beginning of the stream.
Returns:string

public static string RemoveBadCharacters(string str)PUBLICSTATIC

Removes bad, invisible characters that are commonly used to exploit. https://en.wikipedia.org/wiki/Zero-width_non-joiner

ParameterTypeDescription
strstring
Returns:string

public static Rotation Rotation(System.Random self)PUBLICSTATIC

Returns a uniformly random rotation.

ParameterTypeDescription
selfRandom
Returns:Rotation

public static string SimplifyPath(string str)PUBLICSTATIC

Gets rid of ../'s (from /path/folder/../file.txt to /path/file.txt)

ParameterTypeDescription
strstring
Returns:string

public static string Snippet(string source, string find, int padding)PUBLICSTATIC

Given a large string, find all occurrences of a substring and return them with padding. This is useful in situations where you're searching for a word in a hug body of text, and want to show how it's used without displaying the whole text.

ParameterTypeDescription
sourcestring
findstring
paddingint
Returns:string

public static string[] SplitQuotesStrings(string input)PUBLICSTATIC

in : I am "splitting a" string "because it's fun " out : ["I", "am", "splitting a", "string", "because it's fun"]

ParameterTypeDescription
inputstring
Returns:string[]

public static System.Collections.Generic.IEnumerable`1<Vector3> TcbSpline(System.Collections.Generic.IEnumerable`1<Vector3> points, int interpolation, float tension, float continuity, float bias)PUBLICSTATIC

ParameterTypeDescription
pointsIEnumerable<Vector3>
interpolationint
tensionfloat
continuityfloat
biasfloat
Returns:IEnumerable<Vector3>

public static string ToBase36(T i)PUBLICSTATIC

Encode the given number into a Base36 string

ParameterTypeDescription
iT
Returns:string

public static bool ToBool(string str)PUBLICSTATIC

Try to convert to bool. Inputs can be true, false, yes, no, 0, 1, null (caps insensitive)

ParameterTypeDescription
strstring
Returns:bool

public static decimal ToDecimal(string str, decimal Default = default)PUBLICSTATIC

128-bit data type that returns sane results for almost any input. All other numeric types can cast from this.

ParameterTypeDescription
strstring
Default = defaultdecimal
Returns:decimal

public static float ToDouble(string str, float Default = 0)PUBLICSTATIC

Convert to `System.Double`, if not then return `Default`.

ParameterTypeDescription
strstring
Default = 0float
Returns:float

public static double ToDoubleEval(string expression, double Default = 0)PUBLICSTATIC

Convert to `System.Double`. Might be a string formula. This is always going to be slower than a call to `Sandbox.SandboxSystemExtensions.ToDouble(System.String,System.Single)`.

ParameterTypeDescription
expressionstring
Default = 0double
Returns:double

public static float ToFloat(string str, float Default = 0)PUBLICSTATIC

Convert to `System.Single`, if not then return `Default`.

ParameterTypeDescription
strstring
Default = 0float
Returns:float

public static float ToFloatEval(string expression, float Default = 0)PUBLICSTATIC

Convert to `System.Single`. Might be a string formula. This is always going to be slower than a call to `Sandbox.SandboxSystemExtensions.ToFloat(System.String,System.Single)`.

ParameterTypeDescription
expressionstring
Default = 0float
Returns:float

public static System.Guid ToGuid(string input)PUBLICSTATIC

Take a string and create a deterministic guid.

ParameterTypeDescription
inputstring
Returns:Guid

public static int ToInt(string str, int Default = 0)PUBLICSTATIC

Convert to `System.Int32`, if not then return `Default`.

ParameterTypeDescription
strstring
Default = 0int
Returns:int

public static int ToIntEval(string expression, int Default = 0)PUBLICSTATIC

Convert to `System.Int32`. Might be a string formula. This is always going to be slower than a call to `Sandbox.SandboxSystemExtensions.ToInt(System.String,System.Int32)`.

ParameterTypeDescription
expressionstring
Default = 0int
Returns:int

public static long ToLong(string str, long Default = 0)PUBLICSTATIC

Convert to `System.Int64`, if not then return `Default`.

ParameterTypeDescription
strstring
Default = 0long
Returns:long

public static long ToLongEval(string expression, long Default = 0)PUBLICSTATIC

Convert to `System.Int64`. Might be a string formula. This is always going to be slower than a call to `Sandbox.SandboxSystemExtensions.ToLong(System.String,System.Int64)`.

ParameterTypeDescription
expressionstring
Default = 0long
Returns:long

public static string ToRemainingTimeString(System.TimeSpan span)PUBLICSTATIC

ParameterTypeDescription
spanTimeSpan
Returns:string

public static string ToTitleCase(string source)PUBLICSTATIC

Convert a variable name to something more user friendly.

ParameterTypeDescription
sourcestring
Returns:string

public static object ToType(string str, System.Type t)PUBLICSTATIC

Try to politely convert from a string to another type

ParameterTypeDescription
strstring
tType
Returns:object

public static uint ToUInt(string str, int Default = 0)PUBLICSTATIC

Convert to `System.UInt32`, if not then return `Default`.

ParameterTypeDescription
strstring
Default = 0int
Returns:uint

public static ulong ToULong(string str, ulong Default = 0)PUBLICSTATIC

Convert to `System.UInt64`, if not then return `Default`.

ParameterTypeDescription
strstring
Default = 0ulong
Returns:ulong

public static string TrimQuoted(string str, bool ignoreSurroundingSpaces = False)PUBLICSTATIC

The string might start and end in quotes ( ", ' ), remove those if that is the case.

ParameterTypeDescription
strstring
ignoreSurroundingSpaces = Falsebool
Returns:string

public static string Truncate(string str, int maxLength, string appendage = null)PUBLICSTATIC

If the string is longer than this amount of characters then truncate it If appendage is defined, it will be appended to the end of truncated strings (ie, "..")

ParameterTypeDescription
strstring
maxLengthint
appendage = nullstring
Returns:string

public static string TruncateFilename(string str, int maxLength, string appendage = null)PUBLICSTATIC

If the string is longer than this amount of characters then truncate it If appendage is defined, it will be appended to the end of truncated strings (ie, "..")

ParameterTypeDescription
strstring
maxLengthint
appendage = nullstring
Returns:string

public static bool TryToType(string str, System.Type t, object Value)PUBLICSTATIC

Try to politely convert from a string to another type

ParameterTypeDescription
strstring
tType
Valueobject
Returns:bool

public static int UnsignedMod(int a, int b)PUBLICSTATIC

Does what you expected to happen when you did "a % b", that is, handles negative `a` values by returning a positive number from the end.

ParameterTypeDescription
aint
bint
Returns:int

public static string UrlEncode(string str)PUBLICSTATIC

ParameterTypeDescription
strstring
Returns:string

public static Vector2 VectorInCircle(System.Random self, float radius = 1)PUBLICSTATIC

Uniformly samples a 2D position from all points with distance at most `radius` from the origin.

ParameterTypeDescription
selfRandom
radius = 1float
Returns:Vector2

public static Vector3 VectorInSphere(System.Random self, float radius = 1)PUBLICSTATIC

Uniformly samples a 3D position from all points with distance at most `radius` from the origin.

ParameterTypeDescription
selfRandom
radius = 1float
Returns:Vector3

public static Vector2 VectorInSquare(System.Random self, float extents = 1)PUBLICSTATIC

Uniformly samples a 2D position from a square with coordinates in the range -`extents` to +`extents`.

ParameterTypeDescription
selfRandom
extents = 1float
Returns:Vector2

public static bool WildcardMatch(string str, string wildcard)PUBLICSTATIC

Returns true if this string matches a wildcard match. Check is case insensitive. Supports '*' (zero or more chars) and '?' (exactly one char) wildcards. The backslash character '\' escapes '*' to match it literally.

ParameterTypeDescription
strstring
wildcardstring
Returns:bool

public static string WithExtension(string path, string ext)PUBLICSTATIC

Adds or replaces the extension of `path` to `ext`.

ParameterTypeDescription
pathstringA file path with or without an extension.
extstringA file extension with or without a leading period.
Returns:string

public static T WithFlag(T value, T flag, bool set)PUBLICSTATIC

ParameterTypeDescription
valueT
flagT
setbool
Returns:T

On this page

Methodspublic static Angles Angles(System.Random self)public static System.Int32 AsInt(T value)public static System.String Base64Decode(System.String base64EncodedData)public static System.String Base64Encode(System.String plainText)public static System.Int32 BitsSet(System.Int32 i)public static System.Collections.Generic.IEnumerable`1<Vector3> CatmullRomSpline(System.Collections.Generic.IEnumerable`1<Vector3> points, System.Int32 interpolation)public static System.Boolean CheckValidationAttributes(System.Reflection.PropertyInfo prop, System.Object obj, System.String[] errors, System.String name = null)public static T Clamp(T input, T min, T max)public static System.Collections.Generic.Dictionary`2<TKey,TValue> Clone(System.Collections.Generic.Dictionary`2<TKey,TValue> dict)public static System.String CollapseSpacesAndPreserveLines(System.String str)public static System.String CollapseWhiteSpace(System.String str)public static Color Color(System.Random self)public static System.String Columnize(System.String str, System.Int32 maxLength, System.Boolean right = False)public static System.Boolean Contains(System.String source, System.String toCheck, System.StringComparison comp)public static System.Boolean Contains(T value, T flag)public static System.Int32 Distance(System.String source, System.String target)public static System.Double Double(System.Random self, System.Double min, System.Double max)public static System.Double Double(System.Random self, System.Double max = 1)public static System.Int32 FastHash(System.String str)public static System.UInt64 FastHash64(System.String str)public static System.Single Float(System.Random self, System.Single min, System.Single max)public static System.Single Float(System.Random self, System.Single max)public static System.Single Float(System.Random self)public static System.Single FloatDeterministic(System.Random self, System.Int32 i)public static System.Threading.Tasks.Task ForEachTaskAsync(System.Collections.Generic.IEnumerable`1<T> source, System.Func`2<T,System.Threading.Tasks.Task> body, System.Int32 maxRunning = 8, System.Threading.CancellationToken token = null)public static System.String FormatBytes(T input, System.Boolean shortFormat = False)public static System.String FormatNumberShort(System.Int64 num)public static System.String FormatNumberShort(System.UInt64 num)public static System.String FormatSeconds(System.Int64 secs)public static System.String FormatSeconds(System.UInt64 secs)public static System.String FormatSecondsLong(System.Int64 secs)public static System.String FormatSecondsLong(System.UInt64 secs)public static System.String FormatWithSuffix(System.Int32 num)public static T FromArray(System.Random self, T[] array, T defVal = null)public static System.Int64 FromBase36(System.String input)public static T FromList(System.Random self, System.Collections.Generic.List`1<T> array, T defVal = null)public static System.Single Gaussian(System.Random self, System.Single mean = 0, System.Single stdDev = 1)public static Vector2 Gaussian2D(System.Random self, System.Nullable`1<Vector2> mean = null, System.Nullable`1<Vector2> stdDev = null)public static Vector3 Gaussian3D(System.Random self, System.Nullable`1<Vector3> mean = null, System.Nullable`1<Vector3> stdDev = null)public static Vector4 Gaussian4D(System.Random self, System.Nullable`1<Vector4> mean = null, System.Nullable`1<Vector4> stdDev = null)public static T GetAttributeOfType(System.Enum enumVal)public static System.Type GetCommonBaseType(System.Collections.Generic.IEnumerable`1<System.Type> types)public static System.Int32 GetEpoch(System.DateTime d)public static System.String GetFilenameSafe(System.String input)public static System.Int32 GetManagedSize(System.Type t)public static TValue GetOrCreate(System.Collections.Generic.IDictionary`2<TKey,TValue> dict, TKey key)public static T GetPropertyValue(System.Text.Json.Nodes.JsonObject jso, System.String membername, T defaultvalue)public static System.String HtmlEncode(System.String str)public static System.String Humanize(System.DateOnly dateTime)public static System.String Humanize(System.DateTime dateTime)public static System.String Humanize(System.DateTimeOffset dateTime)public static System.String Humanize(System.TimeOnly dateTime)public static System.String Humanize(System.TimeSpan timespan, System.Boolean shortVersion = False, System.Boolean minutes = True, System.Boolean hours = True, System.Boolean days = True)public static System.String Humanize(System.TimeSpan dateTime, System.Int32 precision = 1)public static System.Int32 Int(System.Random self, System.Int32 min, System.Int32 max)public static System.Int32 Int(System.Random self, System.Int32 max)public static System.Void InvokeWithWarning(System.Action action)public static System.Void InvokeWithWarning(System.Action`1<T> action, T arg0)public static System.Void InvokeWithWarning(System.Action`2<T1,T2> action, T1 arg0, T2 arg1)public static System.Boolean IsBasedOnGenericType(System.Type src, System.Type test)public static System.Boolean IsInitOnly(System.Reflection.PropertyInfo property)public static System.Boolean IsPowerOfTwo(System.Int32 x)public static System.Boolean IsValid(Sandbox.IValid obj)public static System.Boolean IsValidTag(System.String source)public static System.String KiloFormat(System.Int32 num)public static System.String KiloFormat(System.Int64 num)public static System.String Md5(System.String input)public static System.String NormalizeFilename(System.String str, System.Boolean enforceInitialSlash, System.Boolean enforceLowerCase, System.Char targetSeparator = /)public static System.String NormalizeFilename(System.String str, System.Boolean enforceInitialSlash = True)public static System.String Plural(System.Int32 a, System.String single, System.String plural)public static System.String QuoteSafe(System.String str, System.Boolean optional = False)public static System.String ReadNullTerminatedString(System.IO.Stream stream, System.Int64 offset)public static System.String RemoveBadCharacters(System.String str)public static Rotation Rotation(System.Random self)public static System.String SimplifyPath(System.String str)public static System.String SizeFormat(System.Int32 bytes)public static System.String SizeFormat(System.Int64 bytes)public static System.String Snippet(System.String source, System.String find, System.Int32 padding)public static System.String[] SplitQuotesStrings(System.String input)public static System.Collections.Generic.IEnumerable`1<Vector3> TcbSpline(System.Collections.Generic.IEnumerable`1<Vector3> points, System.Int32 interpolation, System.Single tension, System.Single continuity, System.Single bias)public static System.String ToBase36(T i)public static System.Boolean ToBool(System.String str)public static System.DateTime ToDateTime(System.Int32 seconds)public static System.DateTime ToDateTime(System.Int64 seconds)public static System.Decimal ToDecimal(System.String str, System.Decimal Default = default)public static System.Single ToDouble(System.String str, System.Single Default = 0)public static System.Double ToDoubleEval(System.String expression, System.Double Default = 0)public static System.Single ToFloat(System.String str, System.Single Default = 0)public static System.Single ToFloatEval(System.String expression, System.Single Default = 0)public static System.Guid ToGuid(System.String input)public static System.Int32 ToInt(System.String str, System.Int32 Default = 0)public static System.Int32 ToIntEval(System.String expression, System.Int32 Default = 0)public static System.Int64 ToLong(System.String str, System.Int64 Default = 0)public static System.Int64 ToLongEval(System.String expression, System.Int64 Default = 0)public static System.String ToMetric(System.Double input, System.Int32 decimals = 2)public static System.String ToMetric(System.Int32 input, System.Int32 decimals = 2)public static System.String ToMetric(System.Int64 input, System.Int32 decimals = 2)public static System.String ToMetric(System.Single input, System.Int32 decimals = 2)public static System.String ToRelativeTimeString(System.DateTime dateTime)public static System.String ToRelativeTimeString(System.TimeSpan span)public static System.String ToRemainingTimeString(System.TimeSpan span)public static System.String ToSimpleString(System.Delegate deleg, System.Boolean includeNamespace = True)public static System.String ToSimpleString(System.Reflection.MemberInfo member, System.Boolean includeNamespace = True)public static System.String ToSimpleString(System.Type type, System.Boolean includeNamespace = True)public static System.String ToTitleCase(System.String source)public static System.Object ToType(System.String str, System.Type t)public static System.UInt32 ToUInt(System.String str, System.Int32 Default = 0)public static System.UInt64 ToULong(System.String str, System.UInt64 Default = 0)public static System.String TrimQuoted(System.String str, System.Boolean ignoreSurroundingSpaces = False)public static System.String Truncate(System.String str, System.Int32 maxLength, System.String appendage = null)public static System.String TruncateFilename(System.String str, System.Int32 maxLength, System.String appendage = null)public static System.Boolean TryToType(System.String str, System.Type t, System.Object Value)public static System.Int32 UnsignedMod(System.Int32 a, System.Int32 b)public static System.String UrlEncode(System.String str)public static Vector2 VectorInCircle(System.Random self, System.Single radius = 1)public static Vector3 VectorInCube(System.Random self, BBox box)public static Vector3 VectorInCube(System.Random self, System.Single extents = 1)public static Vector3 VectorInSphere(System.Random self, System.Single radius = 1)public static Vector2 VectorInSquare(System.Random self, System.Single extents = 1)public static System.Boolean WildcardMatch(System.String str, System.String wildcard)public static System.String WithExtension(System.String path, System.String ext)public static T WithFlag(T value, T flag, System.Boolean set)Metadata