C# 클래스 mstum.utils.Extensions.StringExtensions

파일 보기 프로젝트 열기: mstum/mstum.utils

공개 메소드들

메소드 설명
IfEmpty ( this input, string otherString ) : string

If input is null or empty, return otherString

http://www.stum.de/2010/01/16/extension-method-return-another-string-if-string-is-null-or-empty/

ReplaceAll ( this input, string>.IDictionary replacements ) : string

Replace all occurences of a certain char with a string

http://www.stum.de/2010/02/16/an-extension-method-to-replace-multiple-chars-in-a-string/

SafeSubstring ( this input, int startIndex, int length, string suffix = "" ) : string

A safe Substring method that does not throw an exception if startIndex or length is out of bounds of the string

http://www.stum.de/2009/02/27/a-safe-stringsubstring-extension-method/

Use ( this input ) : string

A shortcut for string.Format

http://www.stum.de/2009/08/20/turning-string-format-into-an-extension-method/

메소드 상세

IfEmpty() 공개 정적인 메소드

If input is null or empty, return otherString
http://www.stum.de/2010/01/16/extension-method-return-another-string-if-string-is-null-or-empty/
public static IfEmpty ( this input, string otherString ) : string
input this
otherString string
리턴 string

ReplaceAll() 공개 정적인 메소드

Replace all occurences of a certain char with a string
http://www.stum.de/2010/02/16/an-extension-method-to-replace-multiple-chars-in-a-string/
public static ReplaceAll ( this input, string>.IDictionary replacements ) : string
input this
replacements string>.IDictionary A dictionary where the key is a char to replace and the value is the string to replace it with. Value can be null.
리턴 string

SafeSubstring() 공개 정적인 메소드

A safe Substring method that does not throw an exception if startIndex or length is out of bounds of the string
http://www.stum.de/2009/02/27/a-safe-stringsubstring-extension-method/
public static SafeSubstring ( this input, int startIndex, int length, string suffix = "" ) : string
input this
startIndex int
length int
suffix string An optional suffix to append if the string is truncated
리턴 string

Use() 공개 정적인 메소드

A shortcut for string.Format
http://www.stum.de/2009/08/20/turning-string-format-into-an-extension-method/
public static Use ( this input ) : string
input this
리턴 string