C# Class gov.va.medora.utils.StringUtils

Mostra file Open project: OSEHRA/mdo

Public Methods

Method Description
LPack ( string s, int ndigits ) : string
SPack ( string s ) : string
asciiAt ( string s, int idx ) : int
extractQuotedString ( string s ) : string

Give a string with a quoted string inside, obtain the first quoted string. e.g. extractQuoteString(@"This is a quoted string: "PEMDAS is the pnuemonic for order of operations"") should return: "PEMDAS is the pnuemonic for order of operations"

filteredString ( string s ) : string
firstIndexOfNum ( string s ) : int
getFirstWhiteSpaceAfter ( string s, int idx ) : int
getIdx ( string lines, string target, int startingIdx ) : int
getMD5Hash ( object input ) : string

Serialize an object and compute it's MDWS hash code

getMD5Hash ( string input ) : string

Convert a string in to a 32 character MD5 hash code

getNCharRandom ( int n ) : string

Get a string of random characters (a-z, A-Z, 0-9) of length n

isAlpha ( string s ) : bool
isAlphaChar ( char c ) : bool
isAlphaNumericChar ( char c ) : bool
isDecimal ( string s ) : bool

Checks to see if a string is numeric and contains a decimal

isEmpty ( String s ) : bool
isNumeric ( string s ) : bool
isNumericChar ( char c ) : bool
isWhiteSpace ( char c ) : bool
piece ( string s, string delimiter, int pieceNum ) : string
prependChars ( string s, char c, int sLen ) : string
removeNonNumericChars ( String s ) : string
reverse ( string s ) : string
split ( string s, char delimiter ) : string[]
split ( string s, string delimiter ) : string[]
strPack ( string s, int n ) : string
stripInvalidXmlCharacters ( string s ) : string

Return a string with all invalid XML 1.0 characters (per W3C standard: http://www.w3.org/TR/REC-xml/#charsets) removed

stripNonPrintableChars ( string s ) : string
trimArray ( string s ) : string[]
trimCrLf ( string s ) : string
trimTrailingZeroes ( string s ) : string
varPack ( string s ) : string

Protected Methods

Method Description
getParameterizedCommandString ( System command ) : string

Method Details

LPack() public static method

public static LPack ( string s, int ndigits ) : string
s string
ndigits int
return string

SPack() public static method

public static SPack ( string s ) : string
s string
return string

asciiAt() public static method

public static asciiAt ( string s, int idx ) : int
s string
idx int
return int

extractQuotedString() public static method

Give a string with a quoted string inside, obtain the first quoted string. e.g. extractQuoteString(@"This is a quoted string: "PEMDAS is the pnuemonic for order of operations"") should return: "PEMDAS is the pnuemonic for order of operations"
public static extractQuotedString ( string s ) : string
s string
return string

filteredString() public static method

public static filteredString ( string s ) : string
s string
return string

firstIndexOfNum() public static method

public static firstIndexOfNum ( string s ) : int
s string
return int

getFirstWhiteSpaceAfter() public static method

public static getFirstWhiteSpaceAfter ( string s, int idx ) : int
s string
idx int
return int

getIdx() public static method

public static getIdx ( string lines, string target, int startingIdx ) : int
lines string
target string
startingIdx int
return int

getMD5Hash() public static method

Serialize an object and compute it's MDWS hash code
public static getMD5Hash ( object input ) : string
input object
return string

getMD5Hash() public static method

Convert a string in to a 32 character MD5 hash code
public static getMD5Hash ( string input ) : string
input string ASCII string
return string

getNCharRandom() public static method

Get a string of random characters (a-z, A-Z, 0-9) of length n
public static getNCharRandom ( int n ) : string
n int The length of the random character string to generate
return string

getParameterizedCommandString() protected method

protected getParameterizedCommandString ( System command ) : string
command System
return string

isAlpha() public static method

public static isAlpha ( string s ) : bool
s string
return bool

isAlphaChar() public static method

public static isAlphaChar ( char c ) : bool
c char
return bool

isAlphaNumericChar() public static method

public static isAlphaNumericChar ( char c ) : bool
c char
return bool

isDecimal() public static method

Checks to see if a string is numeric and contains a decimal
public static isDecimal ( string s ) : bool
s string the string to evaluate
return bool

isEmpty() public static method

public static isEmpty ( String s ) : bool
s String
return bool

isNumeric() public static method

public static isNumeric ( string s ) : bool
s string
return bool

isNumericChar() public static method

public static isNumericChar ( char c ) : bool
c char
return bool

isWhiteSpace() public static method

public static isWhiteSpace ( char c ) : bool
c char
return bool

piece() public static method

public static piece ( string s, string delimiter, int pieceNum ) : string
s string
delimiter string
pieceNum int
return string

prependChars() public static method

public static prependChars ( string s, char c, int sLen ) : string
s string
c char
sLen int
return string

removeNonNumericChars() public static method

public static removeNonNumericChars ( String s ) : string
s String
return string

reverse() public static method

public static reverse ( string s ) : string
s string
return string

split() public static method

public static split ( string s, char delimiter ) : string[]
s string
delimiter char
return string[]

split() public static method

public static split ( string s, string delimiter ) : string[]
s string
delimiter string
return string[]

strPack() public static method

public static strPack ( string s, int n ) : string
s string
n int
return string

stripInvalidXmlCharacters() public static method

Return a string with all invalid XML 1.0 characters (per W3C standard: http://www.w3.org/TR/REC-xml/#charsets) removed
public static stripInvalidXmlCharacters ( string s ) : string
s string String to filter
return string

stripNonPrintableChars() public static method

public static stripNonPrintableChars ( string s ) : string
s string
return string

trimArray() public static method

public static trimArray ( string s ) : string[]
s string
return string[]

trimCrLf() public static method

public static trimCrLf ( string s ) : string
s string
return string

trimTrailingZeroes() public static method

public static trimTrailingZeroes ( string s ) : string
s string
return string

varPack() public static method

public static varPack ( string s ) : string
s string
return string