C# Class Upac.Core.Utilities.StringUtil

Afficher le fichier Open project: 1508/upac-for-umbraco

Méthodes publiques

Méthode Description
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.

Method Details

Clip() public static méthode

public static Clip ( string text, int maxLength, bool ellipsis ) : string
text string
maxLength int
ellipsis bool
Résultat string

Left() public static méthode

public static Left ( string text, int length ) : string
text string
length int
Résultat string

Mid() public static méthode

public static Mid ( string text, int start ) : string
text string
start int
Résultat string

NbspToSpace() public static méthode

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

NewLineToBreak() public static méthode

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.
Résultat string

RemoveMultipleSpaces() public static méthode

Removes multiple spaces between words
public static RemoveMultipleSpaces ( string input ) : string
input string The string to trim.
Résultat string

RemoveNewLines() public static méthode

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

RemoveNewLines() public static méthode

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.
Résultat string

SpaceToNbsp() public static méthode

Converts all spaces to HTML non-breaking spaces
public static SpaceToNbsp ( string input ) : string
input string The string to convert.
Résultat string

Split() public static méthode

public static Split ( string text, string delimiter, bool trim ) : string[]
text string
delimiter string
trim bool
Résultat string[]

WordWrap() public static méthode

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.
Résultat string

WordWrap() public static méthode

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.
Résultat string

WordWrap() public static méthode

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.
Résultat string