C# 클래스 Tp.Core.StringUtils

Basic string manipulation routines.
파일 보기 프로젝트 열기: TargetProcess/Target-Process-Plugins

공개 프로퍼티들

프로퍼티 타입 설명
EmailRegex System.Text.RegularExpressions.Regex
LineBreaks string[]

공개 메소드들

메소드 설명
Base64ToImage ( this base64String ) : Image
ComputeMD5Hash ( this value ) : string
ComputeMD5Hash ( this value, Encoding encoding ) : string
DecodeFromBase64 ( this value ) : string
EncodeToBase64 ( this value ) : string
EqualWithoutSpaces ( this a, string b, System.StringComparison comparison = StringComparison.CurrentCulture ) : bool
GetAbbreviation ( string text ) : string
GetGroupMatch ( this value, string pattern ) : string
GetGroupMatch ( this value, string pattern, int groupId ) : string
GetLastWord ( string name ) : string
GetWords ( string text, char delimiter = ' ' ) : string[]
IsBlank ( this value ) : bool

Verifies whether the specified string is null or white space only. This method is null-safe.

Here is how it works: Assert.IsTrue(StringUtils.IsBlank(null)); Assert.IsTrue(StringUtils.IsBlank("")); Assert.IsTrue(StringUtils.IsBlank(" ")); Assert.IsFalse(StringUtils.IsBlank(" hello "));

IsEmail ( this value ) : bool

Verify whether string is a valid email address.

IsManyWords ( string text, char delimiter = ' ' ) : bool
IsNotBlank ( this value ) : bool

Inverse of IsBlank.

Simplify ( this value ) : string

Remove any whitespace, punctuation and graphics from the specified string, convert result to lower case.

Here is how it works: Assert.IsNull(StringUtils.Simplify(null)); Assert.IsNull(StringUtils.Simplify("")); Assert.IsNull(StringUtils.Simplify(" ")); Assert.AreEqual("helloworld", StringUtils.Simplify(" Hello, World! ")); Assert.AreEqual("iam99yearsold", StringUtils.Simplify(" I am 99 years old! "));

ToIntList ( this ids ) : List
ToStringArray ( this tags ) : string
ToStringList ( this ids ) : List
Truncate ( this originString, int maxLength ) : string

비공개 메소드들

메소드 설명
TrimToEmpty ( this value ) : string
TrimToNull ( this value ) : string

메소드 상세

Base64ToImage() 공개 정적인 메소드

public static Base64ToImage ( this base64String ) : Image
base64String this
리턴 Image

ComputeMD5Hash() 공개 정적인 메소드

public static ComputeMD5Hash ( this value ) : string
value this
리턴 string

ComputeMD5Hash() 공개 정적인 메소드

public static ComputeMD5Hash ( this value, Encoding encoding ) : string
value this
encoding System.Text.Encoding
리턴 string

DecodeFromBase64() 공개 정적인 메소드

public static DecodeFromBase64 ( this value ) : string
value this
리턴 string

EncodeToBase64() 공개 정적인 메소드

public static EncodeToBase64 ( this value ) : string
value this
리턴 string

EqualWithoutSpaces() 공개 정적인 메소드

public static EqualWithoutSpaces ( this a, string b, System.StringComparison comparison = StringComparison.CurrentCulture ) : bool
a this
b string
comparison System.StringComparison
리턴 bool

GetAbbreviation() 공개 정적인 메소드

public static GetAbbreviation ( string text ) : string
text string
리턴 string

GetGroupMatch() 공개 정적인 메소드

public static GetGroupMatch ( this value, string pattern ) : string
value this
pattern string
리턴 string

GetGroupMatch() 공개 정적인 메소드

public static GetGroupMatch ( this value, string pattern, int groupId ) : string
value this
pattern string
groupId int
리턴 string

GetLastWord() 공개 정적인 메소드

public static GetLastWord ( string name ) : string
name string
리턴 string

GetWords() 공개 정적인 메소드

public static GetWords ( string text, char delimiter = ' ' ) : string[]
text string
delimiter char
리턴 string[]

IsBlank() 공개 정적인 메소드

Verifies whether the specified string is null or white space only. This method is null-safe.
Here is how it works: Assert.IsTrue(StringUtils.IsBlank(null)); Assert.IsTrue(StringUtils.IsBlank("")); Assert.IsTrue(StringUtils.IsBlank(" ")); Assert.IsFalse(StringUtils.IsBlank(" hello "));
public static IsBlank ( this value ) : bool
value this The string to test.
리턴 bool

IsEmail() 공개 정적인 메소드

Verify whether string is a valid email address.
public static IsEmail ( this value ) : bool
value this A string.
리턴 bool

IsManyWords() 공개 정적인 메소드

public static IsManyWords ( string text, char delimiter = ' ' ) : bool
text string
delimiter char
리턴 bool

IsNotBlank() 공개 정적인 메소드

Inverse of IsBlank.
public static IsNotBlank ( this value ) : bool
value this The string to test.
리턴 bool

Simplify() 공개 정적인 메소드

Remove any whitespace, punctuation and graphics from the specified string, convert result to lower case.
Here is how it works: Assert.IsNull(StringUtils.Simplify(null)); Assert.IsNull(StringUtils.Simplify("")); Assert.IsNull(StringUtils.Simplify(" ")); Assert.AreEqual("helloworld", StringUtils.Simplify(" Hello, World! ")); Assert.AreEqual("iam99yearsold", StringUtils.Simplify(" I am 99 years old! "));
public static Simplify ( this value ) : string
value this Original value.
리턴 string

ToIntList() 공개 정적인 메소드

public static ToIntList ( this ids ) : List
ids this
리턴 List

ToStringArray() 공개 정적인 메소드

public static ToStringArray ( this tags ) : string
tags this
리턴 string

ToStringList() 공개 정적인 메소드

public static ToStringList ( this ids ) : List
ids this
리턴 List

Truncate() 공개 정적인 메소드

public static Truncate ( this originString, int maxLength ) : string
originString this
maxLength int
리턴 string

프로퍼티 상세

EmailRegex 공개적으로 정적으로 프로퍼티

A regular expression to validate email addresses.
public static Regex,System.Text.RegularExpressions EmailRegex
리턴 System.Text.RegularExpressions.Regex

LineBreaks 공개적으로 정적으로 프로퍼티

public static string[] LineBreaks
리턴 string[]