Aardvark.Base


StringFun

Static members

Static memberDescription
Capitalized(self)
Signature: self:string -> string
FormatInvariant(format, args)
Signature: (format:string * args:obj []) -> string

Same as String.Format, but uses the InvariantCulture formatter (The one we usually want. You know, . as decimal point,...)

IsNullOrEmpty(self)
Signature: self:string -> bool
Join(strings)
Signature: strings:IEnumerable<string> -> string
Join(strings, delimiter)
Signature: (strings:IEnumerable<string> * delimiter:string) -> string
Left(self, n)
Signature: (self:string * n:int) -> string

Returns leftmost n characters of this string.

NestedBracketSplit(text, splitLevel)
Signature: (text:string * splitLevel:int) -> IEnumerable<string>

Splits a nested structure of comma-separated square bracked delimited lists at a specified split level. Level 0 means that the split is performed outside the outermost square brackets. Level 1 means that the split is peformed inside the outermost square brackets. NOTE: The resulting parts are not trimmed. Use the Trim extension to trim all resulting strings.

NestedBracketSplitLevelOne(text)
Signature: text:string -> IEnumerable<string>

Splits a nested structure of comma-separated square bracket delimited lists at level 1, i.e. inside the top most bracket. E.g. "[[a, b], foo, [c, d]]" returns "[a, b]", "foo" and "[c, d]".

Plural(word, s)
Signature: (word:string * s:int) -> string

Returns the english plural of the supplied word (i.e. the word with "s" appended) if the supplied integer is not equal to one. Otherwise the word is returned unchanged.

Plural(word, s)
Signature: (word:string * s:int64) -> string

Returns the english plural of the supplied word (i.e. the word with "s" appended) if the supplied integer is not equal to one. Otherwise the word is returned unchanged.

Right(self, n)
Signature: (self:string * n:int) -> string

Returns rightmost n characters of this string.

SplitOnWhitespace(s)
Signature: s:string -> string []
Sub(self, start, end)
Signature: (self:string * start:int * end:int) -> string

Return the substring for the range [start, end). For the start index, negative indices count from the end. For the end index, negative and the indices and the index 0 count from the end. The ranges are clamped to the input string so that no exceptions can occur. If the the start and end index are crossed, the null string is returned. As an example the call s.Sub(-3, 0) returns a string containing the last 3 characters s or the complete string s if its length is less than 3 characters.

ToBool(self)
Signature: self:string -> bool
ToByte(self)
Signature: self:string -> byte
ToDateTime(self)
Signature: self:string -> DateTime
ToDecimal(self, def)
Signature: (self:string * def:decimal) -> decimal
ToDecimal(self)
Signature: self:string -> decimal
ToDouble(self)
Signature: self:string -> float
ToFloat(self)
Signature: self:string -> float32
ToGuid(self)
Signature: self:string -> Guid
ToGuid(self)
Signature: self:IEnumerable<string> -> Guid
ToGuid(self)
Signature: self:IEnumerable<Guid> -> Guid
ToInt(self)
Signature: self:string -> int
ToLong(self)
Signature: self:string -> int64
ToLower(self)
Signature: (self:string []) -> string []
ToLower(self)
Signature: self:IEnumerable<string> -> IEnumerable<string>
ToSByte(self)
Signature: self:string -> sbyte
ToShort(self)
Signature: self:string -> int16
ToSymbol(str)
Signature: str:string -> Symbol
ToUInt(self)
Signature: self:string -> uint32
ToULong(self)
Signature: self:string -> uint64
ToUpper(self)
Signature: (self:string []) -> string []
ToUpper(self)
Signature: self:IEnumerable<string> -> IEnumerable<string>
ToUShort(self)
Signature: self:string -> uint16
Fork me on GitHub