C# Класс Itenso.Sys.StringTool

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
FormatSafeInvariant ( string format ) : string
SplitQuoted ( string toSplit, char quote, char escape, bool includeEmptyUnquotedSections ) : string[]

Splits a string in the same way as the System.String.Split() method but with support for special treatment for escaped characters and for quoted sections which won't be split.

Escaping supports the following special treatment: escape is followed by 'n': a new line character is inserted escape is followed by 'r': a form feed character is inserted escape is followed by 't': a tabulator character is inserted escape is followed by 'x': the next two characters are interpreted as a hex code of the character to be inserted any other character after the escape is inserted literally Escaping is applied within and outside of quoted sections.

Приватные методы

Метод Описание
GetHexValue ( char c ) : int

Описание методов

FormatSafeInvariant() публичный статический Метод

public static FormatSafeInvariant ( string format ) : string
format string
Результат string

SplitQuoted() публичный статический Метод

Splits a string in the same way as the System.String.Split() method but with support for special treatment for escaped characters and for quoted sections which won't be split.
Escaping supports the following special treatment: escape is followed by 'n': a new line character is inserted escape is followed by 'r': a form feed character is inserted escape is followed by 't': a tabulator character is inserted escape is followed by 'x': the next two characters are interpreted as a hex code of the character to be inserted any other character after the escape is inserted literally Escaping is applied within and outside of quoted sections.
public static SplitQuoted ( string toSplit, char quote, char escape, bool includeEmptyUnquotedSections ) : string[]
toSplit string the string to split
quote char the quoting character, e.g. '"'
escape char an escaping character to use both within and outside /// of quoted sections, e.g. '\\'
includeEmptyUnquotedSections bool whether to return zero-length sections /// outside of quotations or not. empty sections adjacent to a quoted section are /// never returned.
Результат string[]