API Reference

Class List

pc.string

Extended String API

Summary

Static Properties

ASCII_LETTERSAll ASCII letters
ASCII_LOWERCASEAll lowercase letters
ASCII_UPPERCASEAll uppercase letters

Static Methods

formatReturn a string with {n} replaced with the n-th argument
toBoolConvert a string value to a boolean.

Details

Static Properties

ASCII_LETTERSAll ASCII letters
ASCII_LOWERCASEAll lowercase letters
ASCII_UPPERCASEAll uppercase letters

Static Methods

format(s, [arguments])

Return a string with {n} replaced with the n-th argument

var s = pc.string.format("Hello {0}", "world");
console.log(s); // Prints "Hello world"

Parameters

sStringThe string to format
argumentsObjectAll other arguments are substituted into the string

Returns

String The formatted string

toBool(s, [strict])

Convert a string value to a boolean. In non-strict mode (the default), 'true' is converted to true, all other values are converted to false. In strict mode, 'true' is converted to true, 'false' is converted to false, all other values will throw an Exception.

Parameters

sStringThe string to convert
strictBooleanIn strict mode an Exception is thrown if s is not an accepted string value. Defaults to false

Returns

Boolean The converted value