C# 클래스 nl.siegmann.epublib.util.StringUtil

Various String utility functions. Most of the functions herein are re- implementations of the ones in apache commons StringUtils. The reason for re- implementing this is that the functions are fairly simple and using my own implementation saves the inclusion of a 200Kb jar file.
파일 보기 프로젝트 열기: lanfengqi/EpubLib-Sharp

공개 메소드들

메소드 설명
Dispose ( ) : void
StringUtil ( ) : System
collapsePathDots ( String path ) : String

Changes a path containing '..', '.' and empty dirs into a path that doesn't. X/foo/../Y is changed into 'X/Y', etc. Does not handle invalid paths like "../".

defaultIfNull ( String text ) : String

If the given text is null return "", the original text otherwise.

defaultIfNull ( String text, String defaultValue ) : String

If the given text is null return "", the given defaultValue otherwise.

endsWithIgnoreCase ( String source, String suffix ) : bool

Whether the given source string ends with the given suffix, ignoring case.

equals ( String text1, String text2 ) : bool

Null-safe string comparator

hashCode ( String values ) : int
isBlank ( String text ) : bool

Whether the String is null, zero-length and does contain only whitespace.

isEmpty ( String text ) : bool

Whether the given string is null or zero-length.

isNotBlank ( String text ) : bool

Whether the String is not null, not zero-length and does not contain of only whitespace.

substringAfter ( String text, char c ) : String

Gives the substring of the given text after the given separator. If the text does not contain the given separator then "" is returned.

substringAfterLast ( String text, char separator ) : String

Gives the substring of the given text after the last occurrence of the given separator. If the text does not contain the given separator then "" is returned.

substringBefore ( String text, char separator ) : String

Gives the substring of the given text before the given separator. If the text does not contain the given separator then the given text is returned.

substringBeforeLast ( String text, char separator ) : String

Gives the substring of the given text before the last occurrence of the given separator. If the text does not contain the given separator then the given text is returned.

toString ( Object keyValues ) : String

Pretty toString printer.

메소드 상세

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

StringUtil() 공개 메소드

public StringUtil ( ) : System
리턴 System

collapsePathDots() 공개 정적인 메소드

Changes a path containing '..', '.' and empty dirs into a path that doesn't. X/foo/../Y is changed into 'X/Y', etc. Does not handle invalid paths like "../".
public static collapsePathDots ( String path ) : String
path String
리턴 String

defaultIfNull() 공개 정적인 메소드

If the given text is null return "", the original text otherwise.
public static defaultIfNull ( String text ) : String
text String
리턴 String

defaultIfNull() 공개 정적인 메소드

If the given text is null return "", the given defaultValue otherwise.
public static defaultIfNull ( String text, String defaultValue ) : String
text String
defaultValue String
리턴 String

endsWithIgnoreCase() 공개 정적인 메소드

Whether the given source string ends with the given suffix, ignoring case.
public static endsWithIgnoreCase ( String source, String suffix ) : bool
source String
suffix String
리턴 bool

equals() 공개 정적인 메소드

Null-safe string comparator
public static equals ( String text1, String text2 ) : bool
text1 String
text2 String
리턴 bool

hashCode() 공개 정적인 메소드

public static hashCode ( String values ) : int
values String
리턴 int

isBlank() 공개 정적인 메소드

Whether the String is null, zero-length and does contain only whitespace.
public static isBlank ( String text ) : bool
text String
리턴 bool

isEmpty() 공개 정적인 메소드

Whether the given string is null or zero-length.
public static isEmpty ( String text ) : bool
text String
리턴 bool

isNotBlank() 공개 정적인 메소드

Whether the String is not null, not zero-length and does not contain of only whitespace.
public static isNotBlank ( String text ) : bool
text String
리턴 bool

substringAfter() 공개 정적인 메소드

Gives the substring of the given text after the given separator. If the text does not contain the given separator then "" is returned.
public static substringAfter ( String text, char c ) : String
text String
c char
리턴 String

substringAfterLast() 공개 정적인 메소드

Gives the substring of the given text after the last occurrence of the given separator. If the text does not contain the given separator then "" is returned.
public static substringAfterLast ( String text, char separator ) : String
text String
separator char
리턴 String

substringBefore() 공개 정적인 메소드

Gives the substring of the given text before the given separator. If the text does not contain the given separator then the given text is returned.
public static substringBefore ( String text, char separator ) : String
text String
separator char
리턴 String

substringBeforeLast() 공개 정적인 메소드

Gives the substring of the given text before the last occurrence of the given separator. If the text does not contain the given separator then the given text is returned.
public static substringBeforeLast ( String text, char separator ) : String
text String
separator char
리턴 String

toString() 공개 정적인 메소드

Pretty toString printer.
public static toString ( Object keyValues ) : String
keyValues Object
리턴 String