Elementals.js

Latest Version: 3.7 Final 20 December 2018

Method String.strFrom

Summary:

Finds a character in a string and returns the rest of the string from after that point.

Calling Convention:
String.strFrom(character[, fromLast])
Parameters
character
The character to match in this string.
fromLast Optional
If loose true, the last matching character will be used instead of the first. Handy for detecting file extensions.
Returns:
The remainder of the string AFTER the matched character if found. If there is no match a boolean false is returned.

JavaScript

console.log(String('testfile.test.txt').strFrom('.')); // 'test.txt'
console.log(String('testfile.test.txt').strFrom('.', true)); // 'txt'
console.log(String('testfile.test.txt').strFrom('@')); // boolean false

Elementals String Methods

Elementals Extensions

Polyfills

These link to the Mozilla Developer Network (MDN)

Property Key

  • Object
  • Method or Variable
  • "Constant" Variable

Downloads

Advertisement