C# 클래스 Upac.Core.Utilities.StringUtil

파일 보기 프로젝트 열기: 1508/upac-for-umbraco

공개 메소드들

메소드 설명
Clip ( string text, int maxLength, bool ellipsis ) : string
Left ( string text, int length ) : string
Mid ( string text, int start ) : string
NbspToSpace ( string input ) : string

Converts all HTML non-breaking spaces to normal space

NewLineToBreak ( string input ) : string

Converts new line(\n) and carriage return(\r) symbols to HTML line breaks.

RemoveMultipleSpaces ( string input ) : string

Removes multiple spaces between words

RemoveNewLines ( string input ) : string

Removes the new line (\n) and carriage return (\r) symbols.

RemoveNewLines ( string input, bool addSpace ) : string

Removes the new line (\n) and carriage return (\r) symbols.

SpaceToNbsp ( string input ) : string

Converts all spaces to HTML non-breaking spaces

Split ( string text, string delimiter, bool trim ) : string[]
WordWrap ( string input, int charCount ) : string

Wraps the passed string at the at the next whitespace on or after the total charCount has been reached for that line. Uses the environment new line symbol for the break text.

WordWrap ( string input, int charCount, bool cutOff ) : string

Wraps the passed string at the total number of characters (if cuttOff is true) or at the next whitespace (if cutOff is false). Uses the environment new line symbol for the break text.

WordWrap ( string input, int charCount, bool cutOff, string breakText ) : string

Wraps the passed string at the total number of characters (if cuttOff is true) or at the next whitespace (if cutOff is false). Uses the passed breakText for lineBreaks.

메소드 상세

Clip() 공개 정적인 메소드

public static Clip ( string text, int maxLength, bool ellipsis ) : string
text string
maxLength int
ellipsis bool
리턴 string

Left() 공개 정적인 메소드

public static Left ( string text, int length ) : string
text string
length int
리턴 string

Mid() 공개 정적인 메소드

public static Mid ( string text, int start ) : string
text string
start int
리턴 string

NbspToSpace() 공개 정적인 메소드

Converts all HTML non-breaking spaces to normal space
public static NbspToSpace ( string input ) : string
input string The string to convert.
리턴 string

NewLineToBreak() 공개 정적인 메소드

Converts new line(\n) and carriage return(\r) symbols to HTML line breaks.
public static NewLineToBreak ( string input ) : string
input string The string to convert.
리턴 string

RemoveMultipleSpaces() 공개 정적인 메소드

Removes multiple spaces between words
public static RemoveMultipleSpaces ( string input ) : string
input string The string to trim.
리턴 string

RemoveNewLines() 공개 정적인 메소드

Removes the new line (\n) and carriage return (\r) symbols.
public static RemoveNewLines ( string input ) : string
input string The string to search.
리턴 string

RemoveNewLines() 공개 정적인 메소드

Removes the new line (\n) and carriage return (\r) symbols.
public static RemoveNewLines ( string input, bool addSpace ) : string
input string The string to search.
addSpace bool If true, adds a space /// (" ") for each newline and carriage /// return found.
리턴 string

SpaceToNbsp() 공개 정적인 메소드

Converts all spaces to HTML non-breaking spaces
public static SpaceToNbsp ( string input ) : string
input string The string to convert.
리턴 string

Split() 공개 정적인 메소드

public static Split ( string text, string delimiter, bool trim ) : string[]
text string
delimiter string
trim bool
리턴 string[]

WordWrap() 공개 정적인 메소드

Wraps the passed string at the at the next whitespace on or after the total charCount has been reached for that line. Uses the environment new line symbol for the break text.
public static WordWrap ( string input, int charCount ) : string
input string The string to wrap.
charCount int The number of characters /// per line.
리턴 string

WordWrap() 공개 정적인 메소드

Wraps the passed string at the total number of characters (if cuttOff is true) or at the next whitespace (if cutOff is false). Uses the environment new line symbol for the break text.
public static WordWrap ( string input, int charCount, bool cutOff ) : string
input string The string to wrap.
charCount int The number of characters /// per line.
cutOff bool If true, will break in /// the middle of a word.
리턴 string

WordWrap() 공개 정적인 메소드

Wraps the passed string at the total number of characters (if cuttOff is true) or at the next whitespace (if cutOff is false). Uses the passed breakText for lineBreaks.
public static WordWrap ( string input, int charCount, bool cutOff, string breakText ) : string
input string The string to wrap.
charCount int The number of /// characters per line.
cutOff bool If true, will break in /// the middle of a word.
breakText string The line break text to use.
리턴 string