Helper Scripts Collection 1.3.1
API documentation for the helper scripts compatible with Unity3D
Static Public Member Functions | List of all members
NikosAssets.Helpers.Extensions.StringUtils Class Reference

A custom string extension helper class More...

Static Public Member Functions

static ulong GetUInt64Hash (this string text)
 Turn this string into a ulong hash using the SHA256 algorithm More...
 
static ulong GetUInt64Hash (this string text, HashAlgorithm hasher)
 author: https://stackoverflow.com/a/50364956 More...
 
static string CropString (this string text, int maxLength=40, string appendSymbolsOnLengthExceeded="...")
 Crop this string and append with appendSymbolsOnLengthExceeded if the maxLength is exceeded More...
 

Detailed Description

A custom string extension helper class

Member Function Documentation

◆ CropString()

static string NikosAssets.Helpers.Extensions.StringUtils.CropString ( this string  text,
int  maxLength = 40,
string  appendSymbolsOnLengthExceeded = "..." 
)
static

Crop this string and append with appendSymbolsOnLengthExceeded if the maxLength is exceeded

Parameters
text
maxLength
appendSymbolsOnLengthExceeded
Returns
The cropped and appended string, if the maxLength was exceeded. Otherwise the same as before (input = output)

◆ GetUInt64Hash() [1/2]

static ulong NikosAssets.Helpers.Extensions.StringUtils.GetUInt64Hash ( this string  text)
static

Turn this string into a ulong hash using the SHA256 algorithm

Parameters
text
Returns
The ulong hash

◆ GetUInt64Hash() [2/2]

static ulong NikosAssets.Helpers.Extensions.StringUtils.GetUInt64Hash ( this string  text,
HashAlgorithm  hasher 
)
static

author: https://stackoverflow.com/a/50364956

Parameters
text
hasher
Returns