메소드 | 설명 | |
---|---|---|
Base36Decode ( string input ) : long |
Decodes a base36 encoded string to an integer
|
|
Base36Encode ( long value ) : string |
Encodes an integer into a string by mapping to alpha and digits (36 chars) chars are embedded as lower case Example: 4zx12ss
|
|
BinHexToBinary ( string hex ) : byte[] |
Turns a BinHex string that contains raw byte values into a byte array
|
|
BinaryToBinHex ( byte data ) : string |
Converts a byte array into a BinHex string. BinHex is two digit hex byte values squished together into a string.
|
|
BytesToString ( byte buffer, |
Converts a byte array to a stringUtils
|
|
CountLines ( string s ) : int |
Returns a line count for a string
|
|
ExtractString ( string source, string beginDelim, string endDelim, bool caseSensitive = false, bool allowMissingEndDelimiter = false, bool returnDelimiters = false ) : string |
Extracts a string from between a pair of delimiters. Only the first instance is found.
|
|
FromCamelCase ( string camelCase ) : string |
Tries to create a phrase string from CamelCase text. Will place spaces before capitalized letters. Note that this method may not work for round tripping ToCamelCase calls, since ToCamelCase strips more characters than just spaces.
|
|
GetLines ( string s ) : string[] |
Parses a string into an array of lines broken by \r\n or \n
|
|
GetProperty ( string propertyString, string key ) : string |
Retrieves a value from an XML-like string
|
|
GetUrlEncodedKey ( string urlEncoded, string key ) : string |
Retrieves a value by key from a UrlEncoded string.
|
|
Inlist ( string s ) : bool |
Determines if a string is contained in a list of other strings
|
|
LogString ( string output, string filename, |
Simple Logging method that allows quickly writing a string to a file
|
|
NewStringId ( ) : string |
Creates short string id based on a GUID hashcode. Not guaranteed to be unique across machines, but unlikely to duplicate in medium volume situations.
|
|
NormalizeIndentation ( string code ) : string |
Strips any common white space from all lines of text that have the same common white space text. Effectively removes common code indentation from code blocks for example so you can get a left aligned code snippet.
|
|
ParseDecimal ( string input, decimal defaultValue = 0M, IFormatProvider numberFormat = null ) : decimal |
Parses an string into an decimal. If the value can't be parsed a default value is returned instead
|
|
ParseInt ( string input, int defaultValue, IFormatProvider numberFormat = null ) : int |
Parses an string into an integer. If the value can't be parsed a default value is returned instead
|
|
ProperCase ( string Input ) : string |
Return a string in proper Case format
|
|
RandomString ( int size, bool includeNumbers = false ) : string |
Creates a new random string of upper, lower case letters and digits. Very useful for generating random data for storage in test data.
|
|
ReplaceString ( string origString, string findString, string replaceString, bool caseInsensitive ) : string |
Replaces a substring within a string with another substring with optional case sensitivity turned off.
|
|
ReplaceStringInstance ( string origString, string findString, string replaceWith, int instance, bool caseInsensitive ) : string |
String replace function that supports replacing a specific instance with case insensitivity
|
|
Replicate ( char character, int charCount ) : string |
Replicates a character n number of times and returns a string
|
|
Replicate ( string input, int charCount ) : string |
Replicates an input string n number of times
|
|
SetProperty ( string propertyString, string key, string value ) : string |
|
|
SetUrlEncodedKey ( string urlEncoded, string key, string value ) : string |
Allows setting of a value in a UrlEncoded string. If the key doesn't exist a new one is set, if it exists it's replaced with the new value.
|
|
StringToBytes ( string text, |
Converts a string into bytes for storage in any byte[] types buffer or stream format (like MemoryStream).
|
|
StringToStream ( string text, |
Creates a Stream from a string. Internally creates a memory stream and returns that.
|
|
StripNonNumber ( string input ) : string |
Strips all non digit values from a string and only returns the numeric string.
|
|
TerminateString ( string value, string terminator ) : string |
Terminates a string with the given end string/character, but only if the value specified doesn't already exist and the string is not empty.
|
|
TextAbstract ( string text, int length ) : string |
Returns an abstract of the provided text by returning up to Length characters of a text string. If the text is truncated a ... is appended.
|
|
ToCamelCase ( string phrase ) : string |
Takes a phrase and turns it into CamelCase text. White Space, punctuation and separators are stripped
|
|
TrimStart ( string text, string textToTrim, bool caseInsensitive ) : string |
Trims a sub string from a string
|
|
TrimTo ( string value, int charCount ) : string |
Trims a string to a specific number of max characters
|
|
UrlDecode ( string text ) : string |
UrlDecodes a string without requiring System.Web
|
|
UrlEncode ( string text ) : string |
UrlEncodes a string without the requirement for System.Web
|
|
UrlEncodePathSafe ( string text ) : string |
Encodes a few additional characters for use in paths Encodes: . #
|
메소드 | 설명 | |
---|---|---|
Empty ( object text ) : bool | ||
Empty ( string text ) : bool | ||
ParseHexChar ( char c ) : int |
public static BinHexToBinary ( string hex ) : byte[] | ||
hex | string | BinHex string (just two byte hex digits strung together) |
리턴 | byte[] |
public static BinaryToBinHex ( byte data ) : string | ||
data | byte | Raw data to send |
리턴 | string |
public static BytesToString ( byte buffer, |
||
buffer | byte | raw string byte data |
encoding | Character encoding to use. Defaults to Unicode | |
리턴 | string |
public static CountLines ( string s ) : int | ||
s | string | string to count lines for |
리턴 | int |
public static ExtractString ( string source, string beginDelim, string endDelim, bool caseSensitive = false, bool allowMissingEndDelimiter = false, bool returnDelimiters = false ) : string | ||
source | string | Input String to work on |
beginDelim | string | |
endDelim | string | ending delimiter |
caseSensitive | bool | |
allowMissingEndDelimiter | bool | |
returnDelimiters | bool | |
리턴 | string |
public static FromCamelCase ( string camelCase ) : string | ||
camelCase | string | |
리턴 | string |
public static GetLines ( string s ) : string[] | ||
s | string | String to check for lines |
리턴 | string[] |
public static GetProperty ( string propertyString, string key ) : string | ||
propertyString | string | |
key | string | |
리턴 | string |
public static GetUrlEncodedKey ( string urlEncoded, string key ) : string | ||
urlEncoded | string | UrlEncoded String |
key | string | Key to retrieve value for |
리턴 | string |
public static LogString ( string output, string filename, |
||
output | string | |
filename | string | |
encoding | if not specified used UTF-8 | |
리턴 | void |
public static NormalizeIndentation ( string code ) : string | ||
code | string | |
리턴 | string |
public static ParseDecimal ( string input, decimal defaultValue = 0M, IFormatProvider numberFormat = null ) : decimal | ||
input | string | |
defaultValue | decimal | |
numberFormat | IFormatProvider | |
리턴 | decimal |
public static ParseInt ( string input, int defaultValue, IFormatProvider numberFormat = null ) : int | ||
input | string | Input numeric string to be parsed |
defaultValue | int | Optional default value if parsing fails |
numberFormat | IFormatProvider | |
리턴 | int |
public static RandomString ( int size, bool includeNumbers = false ) : string | ||
size | int | The number of characters of the string to generate |
includeNumbers | bool | |
리턴 | string |
public static ReplaceString ( string origString, string findString, string replaceString, bool caseInsensitive ) : string | ||
origString | string | String to do replacements on |
findString | string | The string to find |
replaceString | string | The string to replace found string wiht |
caseInsensitive | bool | If true case insensitive search is performed |
리턴 | string |
public static ReplaceStringInstance ( string origString, string findString, string replaceWith, int instance, bool caseInsensitive ) : string | ||
origString | string | Original input string |
findString | string | The string that is to be replaced |
replaceWith | string | The replacement string |
instance | int | Instance of the FindString that is to be found. if Instance = -1 all are replaced |
caseInsensitive | bool | Case insensitivity flag |
리턴 | string |
public static Replicate ( char character, int charCount ) : string | ||
character | char | |
charCount | int | |
리턴 | string |
public static Replicate ( string input, int charCount ) : string | ||
input | string | |
charCount | int | |
리턴 | string |
public static SetProperty ( string propertyString, string key, string value ) : string | ||
propertyString | string | |
key | string | |
value | string | |
리턴 | string |
public static SetUrlEncodedKey ( string urlEncoded, string key, string value ) : string | ||
urlEncoded | string | A UrlEncoded string of key value pairs |
key | string | |
value | string | |
리턴 | string |
public static StringToBytes ( string text, |
||
text | string | |
encoding | The character encoding to use. Defaults to Unicode | |
리턴 | byte[] |
public static StringToStream ( string text, |
||
text | string | |
encoding | ||
리턴 | Stream |
public static StripNonNumber ( string input ) : string | ||
input | string | |
리턴 | string |
public static TerminateString ( string value, string terminator ) : string | ||
value | string | String to terminate |
terminator | string | String to terminate the value string with |
리턴 | string |
public static TextAbstract ( string text, int length ) : string | ||
text | string | Text to abstract |
length | int | Number of characters to abstract to |
리턴 | string |
public static ToCamelCase ( string phrase ) : string | ||
phrase | string | Text to convert to CamelCase |
리턴 | string |
public static TrimStart ( string text, string textToTrim, bool caseInsensitive ) : string | ||
text | string | |
textToTrim | string | |
caseInsensitive | bool | |
리턴 | string |
public static TrimTo ( string value, int charCount ) : string | ||
value | string | |
charCount | int | |
리턴 | string |
public static UrlDecode ( string text ) : string | ||
text | string | String to decode. |
리턴 | string |
public static UrlEncodePathSafe ( string text ) : string | ||
text | string | |
리턴 | string |