This file was auto generated from template : BuiltInFunctions.nt
ActionFunctions
DebugFunctions
LINQFunctions
ParametersFunctions
StringFunctions
SymbolFunctions
SymbolsFunctions
- ThatAreNotStatic
- ThatArePublic
- ThatAreStatic
- ThatDoNotHaveAttribute
- ThatHaveAttribute
- WhereNameDoesNotEndWith
- WhereNameDoesNotMatch
- WhereNameDoesNotStartWith
- WhereNameEndsWith
- WhereNameMatches
- WhereNamespaceDoesNotEndWith
- WhereNamespaceDoesNotMatch
- WhereNamespaceDoesNotStartWith
- WhereNamespaceEndsWith
- WhereNamespaceMatches
- WhereNamespaceStartsWith
- WhereNameStartsWith
TypeFunctions
TypesFunctions
ArrayFunctions
- Add
- AddRange
- Compact
- Concat
- Contains
- Cycle
- Each
- Filter
- First
- InsertAt
- Join
- Last
- Limit
- Map
- Offset
- RemoveAt
- Reverse
- Size
- Sort
- Uniq
HtmlFunctions
MathFunctions
RegexFunctions
StringFunctions
- Append
- Base64Decode
- Base64Encode
- Capitalize
- Capitalizewords
- Contains
- Downcase
- Empty
- EndsWith
- EqualsIgnoreCase
- Escape
- Handleize
- HmacSha1
- HmacSha256
- IndexOf
- Literal
- LStrip
- Md5
- PadLeft
- PadRight
- Pluralize
- Prepend
- Remove
- RemoveFirst
- RemoveLast
- Replace
- ReplaceFirst
- RStrip
- Sha1
- Sha256
- Size
- Slice
- Slice1
- Split
- StartsWith
- Strip
- StripNewlines
- ToDouble
- ToFloat
- ToInt
- ToLong
- Truncate
- Truncatewords
- Upcase
- Whitespace
TimeSpanFunctions
IParameter Action.BodyParameter(IMethod method)
Returns parameter that receives content sent to a webapi action in a request body. [source code]
string Action.HttpMethod(IMethod method)
Returns the http method used with a webapi action. The http method is extracted from Http* or AcceptVerbs attribute or by naming convention if no attributes are specified. [source code]
IEnumerable<IParameter> Action.Parameters(IMethod method, bool includeBodyParameter = true)
Returns parameters that receive content sent to a webapi action. If includeBodyParameter is specified as false, then the Parameter list returned will not include the parameter that is being sent in the body of the request. [source code]
IType Action.ReturnType(IMethod method)
Returns type that is returned from action unwrapped from Task and ActionResult generics [source code]
string Action.Url(IMethod method)
Returns the url for the Web API action based on route attributes (or the supplied convention route if no attributes are present). Route parameters are converted to TypeScript string interpolation syntax by prefixing all parameters with $ e.g. ${id}. Optional parameters are added as QueryString parameters for GET and HEAD requests. [source code]
void Debug.Throw(string message)
Throws exception and stops rendering [source code]
void Debug.WriteLine(MainTemplateContext context, string text)
Write text on NTypewriter output window [source code]
IEnumerable<object> LINQ.Where(MainTemplateContext context, IEnumerable<object> source, string predicate)
Filters a sequence of values based on a predicate. Predicate uses C# lambda syntax, the same one that is used by LINQ Where method [source code]
IEnumerable<string> Parameters.ToTypeScript(IEnumerable<IParameter> parameters, string nullableType = "null")
IEnumerable<string> String.SplitIntoSeparateWords(string text)
It tries to extract separate words from string [source code]
string String.ToCamelCase(string text)
Converts text case to CamelCase [source code]
string String.ToLowerFirst(string text)
Converts first letter of the given string to lower case [source code]
string String.ToUpperFirst(string text)
Converts first letter of the given string to upper case [source code]
bool Symbol.HasAttribute(ISymbolBase symbol, string attributeName)
Checks if symbol is decorated with an attribute [source code]
IEnumerable<ISymbolBase> Symbols.ThatAreNotStatic(IEnumerable<ISymbolBase> symbols)
Filters symbols by the static modifier [source code]
IEnumerable<ISymbolBase> Symbols.ThatArePublic(IEnumerable<ISymbolBase> symbols)
Filters symbols by the public access modifier [source code]
IEnumerable<ISymbolBase> Symbols.ThatAreStatic(IEnumerable<ISymbolBase> symbols)
Filters symbols by the static modifier [source code]
IEnumerable<ISymbolBase> Symbols.ThatDoNotHaveAttribute(IEnumerable<ISymbolBase> symbols, string attributeName)
Filters symbols by the absence of an attribute [source code]
IEnumerable<ISymbolBase> Symbols.ThatHaveAttribute(IEnumerable<ISymbolBase> symbols, string attributeName)
Filters symbols by the presence of an attribute [source code]
IEnumerable<ISymbolBase> Symbols.WhereNameDoesNotEndWith(IEnumerable<ISymbolBase> symbols, string postfix)
Filters symbols by the end of their name [source code]
IEnumerable<ISymbolBase> Symbols.WhereNameDoesNotMatch(IEnumerable<ISymbolBase> symbols, string pattern)
Filters symbols by a regex pattern [source code]
IEnumerable<ISymbolBase> Symbols.WhereNameDoesNotStartWith(IEnumerable<ISymbolBase> symbols, string prefix)
Filters symbols by the beginning of their name [source code]
IEnumerable<ISymbolBase> Symbols.WhereNameEndsWith(IEnumerable<ISymbolBase> symbols, string postfix)
Filters symbols by the end of their name [source code]
IEnumerable<ISymbolBase> Symbols.WhereNameMatches(IEnumerable<ISymbolBase> symbols, string pattern)
Filters symbols by a regex pattern [source code]
IEnumerable<ISymbolBase> Symbols.WhereNamespaceDoesNotEndWith(IEnumerable<ISymbolBase> symbols, string postfix)
Filters symbols by the end of their namespace [source code]
IEnumerable<ISymbolBase> Symbols.WhereNamespaceDoesNotMatch(IEnumerable<ISymbolBase> symbols, string pattern)
Filters symbols by regex pattern [source code]
IEnumerable<ISymbolBase> Symbols.WhereNamespaceDoesNotStartWith(IEnumerable<ISymbolBase> symbols, string prefix)
Filters symbols by the beginning of their namespace [source code]
IEnumerable<ISymbolBase> Symbols.WhereNamespaceEndsWith(IEnumerable<ISymbolBase> symbols, string postfix)
Filters symbols by the end of their namespace [source code]
IEnumerable<ISymbolBase> Symbols.WhereNamespaceMatches(IEnumerable<ISymbolBase> symbols, string pattern)
Filters symbols by regex pattern [source code]
IEnumerable<ISymbolBase> Symbols.WhereNamespaceStartsWith(IEnumerable<ISymbolBase> symbols, string prefix)
Filters symbols by the beginning of their namespace [source code]
IEnumerable<ISymbolBase> Symbols.WhereNameStartsWith(IEnumerable<ISymbolBase> symbols, string prefix)
Filters symbols by the beginning of their name [source code]
IEnumerable<IType> Type.AllReferencedTypes(IType type, SearchIn searchIn = SearchIn.All)
Returns all types that are used in definition of a given type. [source code]
string Type.ToTypeScriptDefault(IType type)
The default value of the type. (Dictionary types returns {}, enumerable types returns [], boolean types returns false, numeric types returns 0, void returns void(0), Guid types return empty guid string, Date types return new Date(0), all other types return null) [source code]
string Type.ToTypeScriptType(IType type, string nullableTypePostfix = "null")
Converts type name to typescript type name [source code]
IType Type.Unwrap(IType type)
Returns the first TypeArgument of a generic type or the type itself if it's not generic. [source code]
IEnumerable<IType> Types.ThatImplement(IEnumerable<IType> types, string interfaceName)
Filters types based on if a type implements given interface (directly or indirectly) [source code]
IEnumerable<IType> Types.ThatInheritFrom(IEnumerable<IType> types, string baseTypeName)
Filters types based on if a type inherits directly from given type [source code]
Following functions come from Scriban, and you can read more about them in Scriban documentation
IEnumerable Array.Add(IEnumerable list, object value)
Adds a value to the input list. Scriban documentation
IEnumerable Array.AddRange(IEnumerable list1, IEnumerable list2)
Concatenates two lists. Scriban documentation
IEnumerable Array.Compact(IEnumerable list)
Removes any null values from the input list. Scriban documentation
IEnumerable Array.Concat(IEnumerable list1, IEnumerable list2)
Concatenates two lists. Scriban documentation
bool Array.Contains(IEnumerable list, object item)
Returns if a list
contains a specific item
.
Scriban documentation
object Array.Cycle(TemplateContext context, SourceSpan span, IList list, object group = null)
Loops through a group of strings and outputs them in the order that they were passed as parameters. Each time cycle is called, the next string that was passed as a parameter is output. Scriban documentation
ScriptRange Array.Each(TemplateContext context, SourceSpan span, IEnumerable list, object function)
Applies the specified function to each element of the input. Scriban documentation
ScriptRange Array.Filter(TemplateContext context, SourceSpan span, IEnumerable list, object function)
Filters the input list according the supplied filter function. Scriban documentation
object Array.First(IEnumerable list)
Returns the first element of the input list
.
Scriban documentation
IEnumerable Array.InsertAt(IEnumerable list, int index, object value)
Inserts a value
at the specified index in the input list
.
Scriban documentation
string Array.Join(TemplateContext context, SourceSpan span, IEnumerable list, string delimiter, object function = null)
Joins the element of a list separated by a delimiter string and return the concatenated string. Scriban documentation
object Array.Last(IEnumerable list)
Returns the last element of the input list
.
Scriban documentation
IEnumerable Array.Limit(IEnumerable list, int count)
Returns a limited number of elments from the input list Scriban documentation
IEnumerable Array.Map(TemplateContext context, SourceSpan span, object list, string member)
Accepts an array element's attribute as a parameter and creates an array out of each array element's value. Scriban documentation
IEnumerable Array.Offset(IEnumerable list, int index)
Returns the remaining of the list after the specified offset Scriban documentation
IList Array.RemoveAt(IList list, int index)
Removes an element at the specified index
from the input list
Scriban documentation
IEnumerable Array.Reverse(IEnumerable list)
Reverses the input list
Scriban documentation
int Array.Size(IEnumerable list)
Returns the number of elements in the input list
Scriban documentation
IEnumerable Array.Sort(TemplateContext context, SourceSpan span, object list, string member = null)
Sorts the elements of the input list
according to the value of each element or the value of the specified member
of each element
Scriban documentation
IEnumerable Array.Uniq(IEnumerable list)
Returns the unique elements of the input list
.
Scriban documentation
string Html.Escape(string text)
Escapes a HTML input string (replacing &
by &amp;
)
Scriban documentation
string Html.Strip(TemplateContext context, string text)
Removes any HTML tags from the input string Scriban documentation
string Html.UrlEncode(string text)
Converts any URL-unsafe characters in a string into percent-encoded characters. Scriban documentation
string Html.UrlEscape(string text)
Identifies all characters in a string that are not allowed in URLS, and replaces the characters with their escaped variants. Scriban documentation
object Math.Abs(TemplateContext context, SourceSpan span, object value)
Returns the absolute value of a specified number. Scriban documentation
double Math.Ceil(double value)
Returns the smallest integer greater than or equal to the specified number. Scriban documentation
object Math.DividedBy(TemplateContext context, SourceSpan span, double value, object divisor)
Divides the specified value by another value. If the divisor is an integer, the result will be floor to and converted back to an integer. Scriban documentation
double Math.Floor(double value)
Returns the largest integer less than or equal to the specified number. Scriban documentation
string Math.Format(TemplateContext context, SourceSpan span, object value, string format, string culture = null)
Formats a number value with specified .NET standard numeric format strings Scriban documentation
bool Math.IsNumber(object value)
Returns a boolean indicating if the input value is a number Scriban documentation
object Math.Minus(TemplateContext context, SourceSpan span, object value, object with)
Subtracts from the input value the with
value
Scriban documentation
object Math.Modulo(TemplateContext context, SourceSpan span, object value, object with)
Performs the modulo of the input value with the with
value
Scriban documentation
object Math.Plus(TemplateContext context, SourceSpan span, object value, object with)
Performs the addition of the input value with the with
value
Scriban documentation
object Math.Random(TemplateContext context, SourceSpan span, int minValue, int maxValue)
Creates a random number Scriban documentation
double Math.Round(double value, int precision = 0)
Rounds a value to the nearest integer or to the specified number of fractional digits. Scriban documentation
object Math.Times(TemplateContext context, SourceSpan span, object value, object with)
Performs the multiplication of the input value with the with
value
Scriban documentation
string Math.Uuid()
Creates a new UUID Scriban documentation
string Regex.Escape(string pattern)
Escapes a minimal set of characters (\
, *
, +
, ?
, |
, {
, [
, (
,)
, ^
, $
,.
, #
, and white space) by replacing them with their escape codes. This instructs the regular expression engine to interpret these characters literally rather than as metacharacters.
Scriban documentation
ScriptArray Regex.Match(TemplateContext context, string text, string pattern, string options = null)
Searches an input string for a substring that matches a regular expression pattern and returns an array with the match occurences. Scriban documentation
ScriptArray Regex.Matches(TemplateContext context, string text, string pattern, string options = null)
Searches an input string for multiple substrings that matches a regular expression pattern and returns an array with the match occurences. Scriban documentation
string Regex.Replace(TemplateContext context, string text, string pattern, string replace, string options = null)
In a specified input string, replaces strings that match a regular expression pattern with a specified replacement string. Scriban documentation
ScriptArray Regex.Split(TemplateContext context, string text, string pattern, string options = null)
Splits an input string into an array of substrings at the positions defined by a regular expression match. Scriban documentation
string Regex.Unescape(string pattern)
Converts any escaped characters in the input string. Scriban documentation
string String.Append(string text, string with)
Concatenates two strings Scriban documentation
string String.Base64Decode(string text)
Decodes a Base64-encoded string to a byte array. The encoding of the bytes is assumed to be UTF-8. Scriban documentation
string String.Base64Encode(string text)
Encodes a string to its Base64 representation. Its character encoded will be UTF-8. Scriban documentation
string String.Capitalize(string text)
Converts the first character of the passed string to a upper case character. Scriban documentation
string String.Capitalizewords(string text)
Converts the first character of each word in the passed string to a upper case character. Scriban documentation
bool String.Contains(string text, string value)
Returns a boolean indicating whether the input string contains the specified string value
.
Scriban documentation
string String.Downcase(string text)
Converts the string to lower case. Scriban documentation
bool String.Empty(string text)
Returns a boolean indicating whether the input string is an empty string. Scriban documentation
bool String.EndsWith(string text, string value)
Returns a boolean indicating whether the input string ends with the specified string value
.
Scriban documentation
bool String.EqualsIgnoreCase(string text, string value)
Returns a boolean indicating whether the input string is equal to specified string 'value'. Comparison is case insensitive. Scriban documentation
string String.Escape(string text)
Escapes a string with escape characters. Scriban documentation
string String.Handleize(string text)
Returns a url handle from the input string. Scriban documentation
string String.HmacSha1(string text, string secretKey)
Converts a string into a SHA-1 hash using a hash message authentication code (HMAC). Pass the secret key for the message as a parameter to the function. Scriban documentation
string String.HmacSha256(string text, string secretKey)
Converts a string into a SHA-256 hash using a hash message authentication code (HMAC). Pass the secret key for the message as a parameter to the function. Scriban documentation
int String.IndexOf(string text, string search, int? startIndex = null, int? count = null, string stringComparison = null)
Reports the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position and examines a specified number of character positions. Scriban documentation
string String.Literal(string text)
Return a string literal enclosed with double quotes of the input string. Scriban documentation
string String.LStrip(string text)
Removes any whitespace characters on the left side of the input string. Scriban documentation
string String.Md5(string text)
Computes the md5
hash of the input string
Scriban documentation
string String.PadLeft(string text, int width)
Pads a string with leading spaces to a specified total length. Scriban documentation
string String.PadRight(string text, int width)
Pads a string with trailing spaces to a specified total length. Scriban documentation
string String.Pluralize(int number, string singular, string plural)
Outputs the singular or plural version of a string based on the value of a number. Scriban documentation
string String.Prepend(string text, string by)
Concatenates two strings by placing the by
string in from of the text
string
Scriban documentation
string String.Remove(string text, string remove)
Removes all occurrences of a substring from a string. Scriban documentation
string String.RemoveFirst(string text, string remove)
Removes the first occurrence of a substring from a string. Scriban documentation
string String.RemoveLast(string text, string remove)
Removes the last occurrence of a substring from a string. Scriban documentation
string String.Replace(string text, string match, string replace)
Replaces all occurrences of a string with a substring. Scriban documentation
string String.ReplaceFirst(string text, string match, string replace, bool fromEnd = false)
Replaces the first occurrence of a string with a substring. Scriban documentation
string String.RStrip(string text)
Removes any whitespace characters on the right side of the input string. Scriban documentation
string String.Sha1(string text)
Computes the sha1
hash of the input string
Scriban documentation
string String.Sha256(string text)
Computes the sha256
hash of the input string
Scriban documentation
int String.Size(string text)
Returns the number of characters from the input string Scriban documentation
string String.Slice(string text, int start, int? length = null)
The slice returns a substring, starting at the specified index. An optional second parameter can be passed to specify the length of the substring. If no second parameter is given, a substring with the remaining characters will be returned. Scriban documentation
string String.Slice1(string text, int start, int length = 1)
The slice returns a substring, starting at the specified index. An optional second parameter can be passed to specify the length of the substring. If no second parameter is given, a substring with the first character will be returned. Scriban documentation
IEnumerable String.Split(string text, string match)
The split
function takes on a substring as a parameter. The substring is used as a delimiter to divide a string into an array. You can output different parts of an array using array
functions.
Scriban documentation
bool String.StartsWith(string text, string value)
Returns a boolean indicating whether the input string starts with the specified string value
.
Scriban documentation
string String.Strip(string text)
Removes any whitespace characters on the left and right side of the input string. Scriban documentation
string String.StripNewlines(string text)
Removes any line breaks/newlines from a string. Scriban documentation
object String.ToDouble(TemplateContext context, string text)
Converts a string to a double Scriban documentation
object String.ToFloat(TemplateContext context, string text)
Converts a string to a float Scriban documentation
object String.ToInt(TemplateContext context, string text)
Converts a string to an integer Scriban documentation
object String.ToLong(TemplateContext context, string text)
Converts a string to a long 64 bit integer Scriban documentation
string String.Truncate(string text, int length, string ellipsis = null)
Truncates a string down to the number of characters passed as the first parameter. An ellipsis (...) is appended to the truncated string and is included in the character count Scriban documentation
string String.Truncatewords(string text, int count, string ellipsis = null)
Truncates a string down to the number of words passed as the first parameter. An ellipsis (...) is appended to the truncated string. Scriban documentation
string String.Upcase(string text)
Converts the string to uppercase Scriban documentation
bool String.Whitespace(string text)
Returns a boolean indicating whether the input string is empty or contains only whitespace characters. Scriban documentation
TimeSpan TimeSpan.FromDays(double days)
Returns a timespan object that represents a days
interval
Scriban documentation
TimeSpan TimeSpan.FromHours(double hours)
Returns a timespan object that represents a hours
interval
Scriban documentation
TimeSpan TimeSpan.FromMilliseconds(double millis)
Returns a timespan object that represents a milliseconds
interval
Scriban documentation
TimeSpan TimeSpan.FromMinutes(double minutes)
Returns a timespan object that represents a minutes
interval
Scriban documentation
TimeSpan TimeSpan.FromSeconds(double seconds)
Returns a timespan object that represents a seconds
interval
Scriban documentation
TimeSpan TimeSpan.Parse(string text)
Parses the specified input string into a timespan object. Scriban documentation