C# Class Scriban.Helpers.StringFunctions

String functions available through the object 'string' in scriban.
Mostra file Open project: lunet-io/scriban

Public Methods

Method Description
Capitalize ( string text ) : string
Capitalizewords ( string text ) : string
Downcase ( string text ) : string
Handleize ( string text ) : string
LStrip ( string text ) : string
Pluralize ( string single, string multiple, int number ) : string
RStrip ( string text ) : string
Remove ( string remove, string text ) : string
RemoveFirst ( string remove, string text ) : string
Replace ( string match, string replace, string text ) : string
ReplaceFirst ( string match, string replace, string text ) : string
Split ( string pattern, string text ) : IEnumerable
StartsWith ( string start, string text ) : bool
Strip ( string text ) : string
StripNewlines ( string text ) : string
Truncate ( int length, string text ) : string
Truncatewords ( int count, string text ) : string
Upcase ( string text ) : string

Private Methods

Method Description
Register ( ScriptObject builtins ) : void
Slice ( TemplateContext context, ScriptNode callerContext, ScriptArray parameters ) : object
Slice ( string text, int start, int length = -1 ) : string

Method Details

Capitalize() public static method

public static Capitalize ( string text ) : string
text string
return string

Capitalizewords() public static method

public static Capitalizewords ( string text ) : string
text string
return string

Downcase() public static method

public static Downcase ( string text ) : string
text string
return string

Handleize() public static method

public static Handleize ( string text ) : string
text string
return string

LStrip() public static method

public static LStrip ( string text ) : string
text string
return string

Pluralize() public static method

public static Pluralize ( string single, string multiple, int number ) : string
single string
multiple string
number int
return string

RStrip() public static method

public static RStrip ( string text ) : string
text string
return string

Remove() public static method

public static Remove ( string remove, string text ) : string
remove string
text string
return string

RemoveFirst() public static method

public static RemoveFirst ( string remove, string text ) : string
remove string
text string
return string

Replace() public static method

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

ReplaceFirst() public static method

public static ReplaceFirst ( string match, string replace, string text ) : string
match string
replace string
text string
return string

Split() public static method

public static Split ( string pattern, string text ) : IEnumerable
pattern string
text string
return IEnumerable

StartsWith() public static method

public static StartsWith ( string start, string text ) : bool
start string
text string
return bool

Strip() public static method

public static Strip ( string text ) : string
text string
return string

StripNewlines() public static method

public static StripNewlines ( string text ) : string
text string
return string

Truncate() public static method

public static Truncate ( int length, string text ) : string
length int
text string
return string

Truncatewords() public static method

public static Truncatewords ( int count, string text ) : string
count int
text string
return string

Upcase() public static method

public static Upcase ( string text ) : string
text string
return string