String
object
string : Useful namespace for helping with String utility functions
Kind: global namespace
- string :
object
- .stringToJson(attrString) ⇒
object
- .jsonToString(componentData) ⇒
string
- .stringToVector(str) ⇒
object
- .stringToDegVector(str) ⇒
object
- .stringToDimensionValue(val) ⇒
number
- .stringToJson(attrString) ⇒
object
string.stringToJson(attrString) ⇒ Converts and formats the inputted string to a json object.
Kind: static method of string
Returns: object
- - object in json form
Param | Type | Description |
---|---|---|
attrString | string |
the string to be formatted |
string
string.jsonToString(componentData) ⇒ Converts and formats the inputted json object into a string.
Kind: static method of string
Returns: string
- - the string representation of the json object
Param | Type | Description |
---|---|---|
componentData | object |
the json object to be formatted into a string |
object
string.stringToVector(str) ⇒ Converts a string to vector format.
Kind: static method of string
Returns: object
- - the vector version of the inputted string.
Param | Type | Description |
---|---|---|
str | string |
the string to be converted to a vector. Must be of format ‘xx xxx xx…’. |
object
string.stringToDegVector(str) ⇒ Converts a string to vector format where the numbers are pre-converted from radians to degrees.
Kind: static method of string
Returns: object
- - the vector version of the inputted string.
Param | Type | Description |
---|---|---|
str | string |
the string to be converted to a vector. Must be of format ‘xx xxx xx…’. |
number
string.stringToDimensionValue(val) ⇒ Converts a string to vector format where the numbers are pre-converted from a number to an appropriate representation
Kind: static method of string
Returns: number
- - the vector version of the inputted string.
Param | Type | Description |
---|---|---|
val | string |
the string to be converted to a vector. Must be of format ‘x%’ or ‘x/y’. |