ember-string-fns
This addon provides string helpers for Ember templates and components.
To install:
ember install ember-string-fns
Usage
string-char-at
string-char-code-at
string-code-point-at
string-concat
string-ends-with
string-equals
string-from-char-code
string-from-code-point
string-html-safe
string-includes
string-index-of
string-last-index-of
string-not-equals
string-pad-end
string-pad-start
string-repeat
string-replace
string-replace-all
string-slice
string-split
string-starts-with
string-substring
string-to-camel-case
string-to-kebab-case
string-to-lower-case
string-to-pascal-case
string-to-sentence-case
string-to-snake-case
string-to-title-case
string-to-upper-case
string-trim
string-trim-end
string-trim-start
string-char-at
Get a character from a string at an index. See String.charAt() for details on the String.charAt function.
string-char-code-at
Get a character by utf-16 code. See String.charCodeAt() for details on the String.charCodeAt function.
string-code-point-at
Get a code by code point. See String.codePointAt() for details on the String.codePointAt function.
string-concat
Concatenate a series of strings. See String.concat() for details on the String.concat function.
string-ends-with
Returns true if a string ends with another string. See String.endsWith() for details on the String.endsWith function.
string-equals
Determines if a string equals another string.
string-from-char-code
Get a character from utf-16 codes. See String.fromCharCode() for details on the String.fromCharCode function.
string-from-code-point
Get a character from code points. See String.fromCodePoint() for details on the String.fromCodePoint function.
string-html-safe
Output an HTML safe string. See htmlSafe() for details on the htmlSafe
function.
string-includes
Returns true if a string includes another string. See String.includes() for details on the String.includes function.
string-index-of
Returns the first occurrence index where the substring begins. See String.indexOf() for details on the String.indexOf function.
string-last-index-of
Returns the last occurrence index where the substring begins. See String.lastIndexOf() for details on the String.lastIndexOf function.
string-not-equals
Determines if a string does not equal another string.
string-pad-end
Returns true if a string ends with another string. See String.padEnd() for details on the String.padEnd function.
string-pad-start
Returns true if a string ends with another string. See String.padStart() for details on the String.padStart function.
string-repeat
Repeat a string a number of times. See String.repeat() for details on the String.repeat function.
string-replace
Replace first occurence of a string with another string.
string-replace-all
Replace all occurences of a string with another string.
string-slice
Extract a slice from a string. See String.slice() for details on the String.slice function.
string-split
Split a string into a string[] by a delimiter. See String.split() for details on the String.split function.
string-starts-with
Returns true if a string starts with another string. See String.startsWith() for details on the String.startsWith function.
string-substring
Extract a substring from a string. See String.substring() for details on the String.substring function.
string-to-camel-case
Convert a string to camel case (camelCase). See Camel Case for details.
string-to-kebab-case
Convert a string to kebab case (kebab-case). See Kebab Case for details.
string-to-lower-case
Convert a string to lower case. See String.toLowerCase() for details on the String.toLowerCase function.
string-to-pascal-case
Convert a string to pascal case (PascalCase). See Pascal Case for details.
string-to-sentence-case
Convert a string to sentence case (Sentence case.). See Sentence Case for details. Note, sentences are considered a group of words that are completed with a !, ?, or .
string-to-snake-case
Convert a string to snake case (snake_case). See Snake Case for details.
string-to-title-case
Convert a string to title case (Title Case). See Title Case for details. Note, due to the subjectivity of subsets, all words are operated against.
string-to-upper-case
Convert a string to upper case. See String.toUpperCase() for details on the String.toUpperCase function.
string-trim
Trim the start and end of a string. See String.trim() for details on the String.trim function.
string-trim-end
Trim the end of a string. See String.endsWith() for details on the String.endsWith function.
string-trim-start
Trim the start of a string. See String.trimStart() for details on the String.trimStart function.
Related Addons
- See ember-array-fns for array based helpers.
- See ember-datetime-fns for date and time based helpers.
- See ember-intl-fns for internationalization based helpers.
- See ember-logic-fns for logical based helpers.
- See ember-math-fns for math based helpers.
- See ember-number-fns for number based helpers.
Compatibility
- Ember.js v3.4 or above
- Ember CLI v2.13 or above
- Node.js v8 or above
Contributing
See the Contributing guide for details.
License
This project is licensed under the MIT License.