C# 클래스 Org.IdentityConnectors.Common.StringUtil

파일 보기 프로젝트 열기: Tirasa/ConnId

공개 메소드들

메소드 설명
EndsWith ( string str, char value ) : bool

Determines if the string parameter 'str' ends with the character value.

IndexOf ( string src, char ch ) : int
IndexOf ( string src, char ch, int idx ) : int
IndexOfDigit ( string str ) : int

Finds the index of the first digit.

IndexOfDigit ( string str, int startidx ) : int

Finds the index of the first digit and starts from the index specified.

IndexOfIgnoreCase ( string src, string cmp ) : int

Finds the start index of the comparison string regards of case.

IndexOfNonDigit ( string str ) : int

Finds the index of the first non digit.

IndexOfNonDigit ( string str, int startidx ) : int

Finds the index of the first non digit and starts from the index specified.

IsBlank ( string val ) : bool

Checks if a String is whitespace, empty ("") or null.

 StringUtil.IsBlank(null)      = true StringUtil.IsBlank("")        = true StringUtil.IsBlank(" ")       = true StringUtil.IsBlank("bob")     = false StringUtil.IsBlank("  bob  ") = false 

IsEmpty ( string value ) : bool

Determines if a string is empty. Empty is defined as null or empty string.

 StringUtil.IsEmpty(null)     = true StringUtil.IsEmpty("")       = true StringUtil.IsEmpty(" ")      = false StringUtil.IsEmpty("bob")    = false StringUtil.IsEmpty(" bob ")  = false 

IsNotBlank ( string val ) : bool

Checks if a String is not empty (""), not null and not whitespace only.

 StringUtil.IsNotBlank(null)      = false StringUtil.IsNotBlank("")        = false StringUtil.IsNotBlank(" ")       = false StringUtil.IsNotBlank("bob")     = true StringUtil.IsNotBlank("  bob  ") = true 

IsNotEmpty ( string val ) : bool

Determines if a string is not empty. Its the exact opposite for #IsEmpty(String).

IsTrue ( string val ) : bool
IsWhitespace ( char ch ) : bool

Determine if this is a white space character. Whitespace characters are defined as the character ' ' and the tab character.

NewGuardedString ( char val ) : GuardedString

Constructs a secure string from a char []. The char[] will be cleared out when finished.

ParseLine ( string line, char fsep, char tqul ) : IList

Parses a line into a List of strings.

RandomString ( ) : string

Create a random Unicode string.

RandomString ( Random r ) : string

Create a random length Unicode string based on the Random object passed in.

RandomString ( Random random, int length ) : string

Create a random string of fixed length based on the Random object passed in. Insure that the string is built w/ Unicode characters.

ReplaceVariable ( string o, string variable, string val ) : string

Simple variable replacement internally using regular expressions.

 String o = "Some string with a ${variable} in it." String n = replaceVariable(o, "variable", "something"); String r = "Some string with a something in it" assert r.equals(n); 

StripNewlines ( string src ) : string

Removes newline characters (0x0a and 0x0d) from a string.

StripXmlAttribute ( string src, string attrName ) : string

Removes the attribute from the source string and returns.

StripXmlComments ( string src ) : string

Strip XML comments.

SubDigitString ( string str ) : string

Return the string of digits from string.

SubDigitString ( string str, int idx ) : string

Return the string of digits from string.

메소드 상세

EndsWith() 공개 정적인 메소드

Determines if the string parameter 'str' ends with the character value.
public static EndsWith ( string str, char value ) : bool
str string /// String to check for the character at the end.
value char /// The character to look for at the end of the string.
리턴 bool

IndexOf() 공개 정적인 메소드

public static IndexOf ( string src, char ch ) : int
src string
ch char
리턴 int

IndexOf() 공개 정적인 메소드

public static IndexOf ( string src, char ch, int idx ) : int
src string
ch char
idx int
리턴 int

IndexOfDigit() 공개 정적인 메소드

Finds the index of the first digit.
public static IndexOfDigit ( string str ) : int
str string /// String to seach for a digit.
리턴 int

IndexOfDigit() 공개 정적인 메소드

Finds the index of the first digit and starts from the index specified.
public static IndexOfDigit ( string str, int startidx ) : int
str string /// String to search for a digit.
startidx int /// Starting index from which to search
리턴 int

IndexOfIgnoreCase() 공개 정적인 메소드

Finds the start index of the comparison string regards of case.
public static IndexOfIgnoreCase ( string src, string cmp ) : int
src string /// String to search.
cmp string /// Comparsion string to find.
리턴 int

IndexOfNonDigit() 공개 정적인 메소드

Finds the index of the first non digit.
public static IndexOfNonDigit ( string str ) : int
str string /// String to seach for a non digit.
리턴 int

IndexOfNonDigit() 공개 정적인 메소드

Finds the index of the first non digit and starts from the index specified.
public static IndexOfNonDigit ( string str, int startidx ) : int
str string /// String to seach for a non digit.
startidx int /// Starting index from which to search.
리턴 int

IsBlank() 공개 정적인 메소드

Checks if a String is whitespace, empty ("") or null.
 StringUtil.IsBlank(null)      = true StringUtil.IsBlank("")        = true StringUtil.IsBlank(" ")       = true StringUtil.IsBlank("bob")     = false StringUtil.IsBlank("  bob  ") = false 
public static IsBlank ( string val ) : bool
val string /// the String to check, may be null ///
리턴 bool

IsEmpty() 공개 정적인 메소드

Determines if a string is empty. Empty is defined as null or empty string.
 StringUtil.IsEmpty(null)     = true StringUtil.IsEmpty("")       = true StringUtil.IsEmpty(" ")      = false StringUtil.IsEmpty("bob")    = false StringUtil.IsEmpty(" bob ")  = false 
public static IsEmpty ( string value ) : bool
value string
리턴 bool

IsNotBlank() 공개 정적인 메소드

Checks if a String is not empty (""), not null and not whitespace only.
 StringUtil.IsNotBlank(null)      = false StringUtil.IsNotBlank("")        = false StringUtil.IsNotBlank(" ")       = false StringUtil.IsNotBlank("bob")     = true StringUtil.IsNotBlank("  bob  ") = true 
public static IsNotBlank ( string val ) : bool
val string /// the String to check, may be null ///
리턴 bool

IsNotEmpty() 공개 정적인 메소드

Determines if a string is not empty. Its the exact opposite for #IsEmpty(String).
public static IsNotEmpty ( string val ) : bool
val string /// string to evaluate.
리턴 bool

IsTrue() 공개 정적인 메소드

public static IsTrue ( string val ) : bool
val string
리턴 bool

IsWhitespace() 공개 정적인 메소드

Determine if this is a white space character. Whitespace characters are defined as the character ' ' and the tab character.
public static IsWhitespace ( char ch ) : bool
ch char
리턴 bool

NewGuardedString() 공개 정적인 메소드

Constructs a secure string from a char []. The char[] will be cleared out when finished.
public static NewGuardedString ( char val ) : GuardedString
val char The characters to use. Will be cleared /// out.
리턴 GuardedString

ParseLine() 공개 정적인 메소드

Parses a line into a List of strings.
public static ParseLine ( string line, char fsep, char tqul ) : IList
line string /// String to parse.
fsep char /// Field separator
tqul char /// Text qualifier.
리턴 IList

RandomString() 공개 정적인 메소드

Create a random Unicode string.
public static RandomString ( ) : string
리턴 string

RandomString() 공개 정적인 메소드

Create a random length Unicode string based on the Random object passed in.
public static RandomString ( Random r ) : string
r System.Random
리턴 string

RandomString() 공개 정적인 메소드

Create a random string of fixed length based on the Random object passed in. Insure that the string is built w/ Unicode characters.
public static RandomString ( Random random, int length ) : string
random System.Random /// used to get random unicode characters.
length int /// fixed length of string.
리턴 string

ReplaceVariable() 공개 정적인 메소드

Simple variable replacement internally using regular expressions.
 String o = "Some string with a ${variable} in it." String n = replaceVariable(o, "variable", "something"); String r = "Some string with a something in it" assert r.equals(n); 
/// if o is null, var is blank, or val is null.
public static ReplaceVariable ( string o, string variable, string val ) : string
o string /// Original string to do the replacement on.
variable string /// String representation of the variable to replace.
val string /// Value to replace the variable with.
리턴 string

StripNewlines() 공개 정적인 메소드

Removes newline characters (0x0a and 0x0d) from a string.
public static StripNewlines ( string src ) : string
src string
리턴 string

StripXmlAttribute() 공개 정적인 메소드

Removes the attribute from the source string and returns.
public static StripXmlAttribute ( string src, string attrName ) : string
src string
attrName string
리턴 string

StripXmlComments() 공개 정적인 메소드

Strip XML comments.
public static StripXmlComments ( string src ) : string
src string
리턴 string

SubDigitString() 공개 정적인 메소드

Return the string of digits from string.
public static SubDigitString ( string str ) : string
str string /// Source string to search.
리턴 string

SubDigitString() 공개 정적인 메소드

Return the string of digits from string.
public static SubDigitString ( string str, int idx ) : string
str string /// Source string to search.
idx int /// Start index from which to search.
리턴 string