Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 565 Bytes

startsWith.md

File metadata and controls

33 lines (21 loc) · 565 Bytes

strings.startsWith

startsWith(string, substr)

StartsWith tests a string to see if it starts with a substring

Arguments

  1. string (string): input string
  2. substr (string): substring to test

Returns

(boolean): does the input start with the substring?

Example

const result = strings.startsWith('This sentence starts with', 'This');
console.log(result);
> true