instance method String#startsWith

View source on GitHub →

String#startsWith(substring) → Boolean

Checks if the string starts with substring.

Example
'Prototype JavaScript'.startsWith('Pro');
//-> true