C# Класс Upac.Core.Utilities.StringUtil

Показать файл Открыть проект

Открытые методы

Метод Описание
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