C# Class Fanx.Util.StrUtil

StrUtil provides helpful methods for string manipulation.
ファイルを表示 Open project: xored/f4

Public Methods

Method Description
Replace ( string s, string match, string replace ) : string
asCode ( string s ) : string

Translate the specified string as it would appear in code as a string literal. For example all newlines appear as \n.

flagsToString ( int flags ) : string
getSpaces ( int len ) : string

Get a string containing the specified number of spaces.

padl ( string s, int len ) : string

Pad to the left to ensure string is specified length. If s.length already greater than len, do nothing.

padr ( string s, int len ) : string

Pad to the right to ensure string is specified length. If s.length already greater than len, do nothing.

toOrder ( int index ) : string

Return a zero based index as "first", "second", etc.

Private Methods

Method Description
StrUtil ( ) : System

Method Details

Replace() public static method

public static Replace ( string s, string match, string replace ) : string
s string
match string
replace string
return string

asCode() public static method

Translate the specified string as it would appear in code as a string literal. For example all newlines appear as \n.
public static asCode ( string s ) : string
s string
return string

flagsToString() public static method

public static flagsToString ( int flags ) : string
flags int
return string

getSpaces() public static method

Get a string containing the specified number of spaces.
public static getSpaces ( int len ) : string
len int
return string

padl() public static method

Pad to the left to ensure string is specified length. If s.length already greater than len, do nothing.
public static padl ( string s, int len ) : string
s string
len int
return string

padr() public static method

Pad to the right to ensure string is specified length. If s.length already greater than len, do nothing.
public static padr ( string s, int len ) : string
s string
len int
return string

toOrder() public static method

Return a zero based index as "first", "second", etc.
public static toOrder ( int index ) : string
index int
return string