C# 클래스 Rolcore.StringExtensions

Extensions for String.
파일 보기 프로젝트 열기: Rollins/Rolcore

공개 메소드들

메소드 설명
EnsureTrailing ( this s, char c ) : string

Checks that the string ends with the specified character. If it doesn't then the character is appended.

First ( this s, int numberOfCharacters ) : string

Returns the first part of a string, up to a specified number of characters.

FromBase64String ( this s ) : string

Converts the string from a Base64 encoded string to a "regular" string.

FromBase64UriSafeString ( this s ) : string

Converts the string from a Base64 encoded string to a "regular" string.

IsPalindrome ( this s ) : bool

Determines if the given string is a palindrome (can be read the same forwards and backwards).

Repeat ( this s, int numberOfTimes ) : string

Repeats a string some number of times.

Reverse ( this s ) : string

Reverses the given string.

ToBase64String ( this s ) : string

Converts the string to a Base64 encoded string.

ToBase64UriSafeString ( this s ) : string

Converts the string to a URI-safe Base64 encoded string. Read about URL and file safe base64 encoding at http://tools.ietf.org/html/rfc4648#page-7.

ToSHA1String ( this s ) : string

Computes a SHA-1 hash of the specified string.

ToUri ( this s, Uri baseUri = null ) : Uri

Converts the string to a Uri.

메소드 상세

EnsureTrailing() 공개 정적인 메소드

Checks that the string ends with the specified character. If it doesn't then the character is appended.
public static EnsureTrailing ( this s, char c ) : string
s this Specifies the string to check.
c char Specifies the character to check for.
리턴 string

First() 공개 정적인 메소드

Returns the first part of a string, up to a specified number of characters.
public static First ( this s, int numberOfCharacters ) : string
s this The string from which to get the sub string.
numberOfCharacters int The number of characters to get from the string
리턴 string

FromBase64String() 공개 정적인 메소드

Converts the string from a Base64 encoded string to a "regular" string.
public static FromBase64String ( this s ) : string
s this The string to decode.
리턴 string

FromBase64UriSafeString() 공개 정적인 메소드

Converts the string from a Base64 encoded string to a "regular" string.
public static FromBase64UriSafeString ( this s ) : string
s this The string to decode.
리턴 string

IsPalindrome() 공개 정적인 메소드

Determines if the given string is a palindrome (can be read the same forwards and backwards).
public static IsPalindrome ( this s ) : bool
s this Specifies the string to check.
리턴 bool

Repeat() 공개 정적인 메소드

Repeats a string some number of times.
public static Repeat ( this s, int numberOfTimes ) : string
s this The string to be repeated.
numberOfTimes int The number of times to repeat the string. A value of zero /// returns an empty string, a value of one returns the original string, a value of two or /// more returns the string repeated that number of times.
리턴 string

Reverse() 공개 정적인 메소드

Reverses the given string.
public static Reverse ( this s ) : string
s this Specfies the string to reverse.
리턴 string

ToBase64String() 공개 정적인 메소드

Converts the string to a Base64 encoded string.
public static ToBase64String ( this s ) : string
s this The string to encode
리턴 string

ToBase64UriSafeString() 공개 정적인 메소드

Converts the string to a URI-safe Base64 encoded string. Read about URL and file safe base64 encoding at http://tools.ietf.org/html/rfc4648#page-7.
public static ToBase64UriSafeString ( this s ) : string
s this The string to encode
리턴 string

ToSHA1String() 공개 정적인 메소드

Computes a SHA-1 hash of the specified string.
public static ToSHA1String ( this s ) : string
s this The string to hash.
리턴 string

ToUri() 공개 정적인 메소드

Converts the string to a Uri.
public static ToUri ( this s, Uri baseUri = null ) : Uri
s this Specifies the string to convert.
baseUri System.Uri Optionally specifies the base URI if the specified string is (or might be) relative.
리턴 System.Uri