This addon provides string helpers for Ember templates and components.
To install:
ember install ember-string-fns
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
Get a character from a string at an index. See String.charAt() for details on the String.charAt function.
Get a character by utf-16 code. See String.charCodeAt() for details on the String.charCodeAt function.
Get a code by code point. See String.codePointAt() for details on the String.codePointAt function.
Concatenate a series of strings. See String.concat() for details on the String.concat function.
Returns true if a string ends with another string. See String.endsWith() for details on the String.endsWith function.
Determines if a string equals another string.
Get a character from utf-16 codes. See String.fromCharCode() for details on the String.fromCharCode function.
Get a character from code points. See String.fromCodePoint() for details on the String.fromCodePoint function.
Output an HTML safe string. See htmlSafe() for details on the htmlSafe
function.
Returns true if a string includes another string. See String.includes() for details on the String.includes function.
Returns the first occurrence index where the substring begins. See String.indexOf() for details on the String.indexOf function.
Returns the last occurrence index where the substring begins. See String.lastIndexOf() for details on the String.lastIndexOf function.
Determines if a string does not equal another string.
Returns true if a string ends with another string. See String.padEnd() for details on the String.padEnd function.
Returns true if a string ends with another string. See String.padStart() for details on the String.padStart function.
Repeat a string a number of times. See String.repeat() for details on the String.repeat function.
Replace first occurence of a string with another string.
Replace all occurences of a string with another string.
Extract a slice from a string. See String.slice() for details on the String.slice function.
Split a string into a string[] by a delimiter. See String.split() for details on the String.split function.
Returns true if a string starts with another string. See String.startsWith() for details on the String.startsWith function.
Extract a substring from a string. See String.substring() for details on the String.substring function.
Convert a string to camel case (camelCase). See Camel Case for details.
Convert a string to kebab case (kebab-case). See Kebab Case for details.
Convert a string to lower case. See String.toLowerCase() for details on the String.toLowerCase function.
Convert a string to pascal case (PascalCase). See Pascal Case for details.
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 .
Convert a string to snake case (snake_case). See Snake Case for details.
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.
Convert a string to upper case. See String.toUpperCase() for details on the String.toUpperCase function.
Trim the start and end of a string. See String.trim() for details on the String.trim function.
Trim the end of a string. See String.endsWith() for details on the String.endsWith function.
Trim the start of a string. See String.trimStart() for details on the String.trimStart function.
- 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.
- Ember.js v3.4 or above
- Ember CLI v2.13 or above
- Node.js v8 or above
See the Contributing guide for details.
This project is licensed under the MIT License.