C# 클래스 MONI.Util.StringParserHelper

파일 보기 프로젝트 열기: dotob/moni

공개 메소드들

메소드 설명
SplitOnFirst ( this s, string separator ) : string>.Tuple
SplitOnLast ( this s, string separator ) : string>.Tuple
SplitWithIgnoreRegions ( this s, char separators ) : IEnumerable
Token ( this s, string separator, int token ) : string

small convenience method to access token (parts) of a string "la-li-lu".Token('-', 1) == "la" "la-li-lu".Token('-', 4) == string.empty "la-li-lu".Token('-', 0) == "la-li-lu" "la-li-lu".Token('-', -1) == "lu" String.empty.Token('-', x) == string.empty // for all x the index is not nullbased!! so the first token is 1 and the last token is -1

Token ( this s, string separator, int token, string fallback ) : string

small convenience method to access token (parts) of a string "la-li-lu".Token('-', 1) == "la" "la-li-lu".Token('-', 4) == fallback "la-li-lu".Token('-', 0) == "la-li-lu" "la-li-lu".Token('-', -1) == "lu" String.empty.Token('-', x) == fallback // for all x the index is not nullbased!! so the first token is 1 and the last token is -1

TokenReturnInputIfFail ( this s, string separator, int token ) : string

small convenience method to access token (parts) of a string "la-li-lu".Token('-', 1) == "la" "la-li-lu".Token('-', 4) == input "la-li-lu".Token('-', 0) == "la-li-lu" "la-li-lu".Token('-', -1) == "lu" String.empty.Token('-', x) == input // for all x the index is not nullbased!! so the first token is 1 and the last token is -1

메소드 상세

SplitOnFirst() 공개 정적인 메소드

public static SplitOnFirst ( this s, string separator ) : string>.Tuple
s this
separator string
리턴 string>.Tuple

SplitOnLast() 공개 정적인 메소드

public static SplitOnLast ( this s, string separator ) : string>.Tuple
s this
separator string
리턴 string>.Tuple

SplitWithIgnoreRegions() 공개 정적인 메소드

public static SplitWithIgnoreRegions ( this s, char separators ) : IEnumerable
s this
separators char
리턴 IEnumerable

Token() 공개 정적인 메소드

small convenience method to access token (parts) of a string "la-li-lu".Token('-', 1) == "la" "la-li-lu".Token('-', 4) == string.empty "la-li-lu".Token('-', 0) == "la-li-lu" "la-li-lu".Token('-', -1) == "lu" String.empty.Token('-', x) == string.empty // for all x the index is not nullbased!! so the first token is 1 and the last token is -1
public static Token ( this s, string separator, int token ) : string
s this the given string to split
separator string the separator the split is done with
token int index of token to use, this is 1-based
리턴 string

Token() 공개 정적인 메소드

small convenience method to access token (parts) of a string "la-li-lu".Token('-', 1) == "la" "la-li-lu".Token('-', 4) == fallback "la-li-lu".Token('-', 0) == "la-li-lu" "la-li-lu".Token('-', -1) == "lu" String.empty.Token('-', x) == fallback // for all x the index is not nullbased!! so the first token is 1 and the last token is -1
public static Token ( this s, string separator, int token, string fallback ) : string
s this the given string to split
separator string the separator the split is done with
token int index of token to use, this is 1-based
fallback string what will be returned if separator is not found
리턴 string

TokenReturnInputIfFail() 공개 정적인 메소드

small convenience method to access token (parts) of a string "la-li-lu".Token('-', 1) == "la" "la-li-lu".Token('-', 4) == input "la-li-lu".Token('-', 0) == "la-li-lu" "la-li-lu".Token('-', -1) == "lu" String.empty.Token('-', x) == input // for all x the index is not nullbased!! so the first token is 1 and the last token is -1
public static TokenReturnInputIfFail ( this s, string separator, int token ) : string
s this the given string to split
separator string the separator the split is done with
token int index of token to use, this is 1-based
리턴 string