0

I have a string like below

https://maps.googleapis.com/maps/api/streetview?channel=rdc-ldp-streetview&client=sourcemaps

How do i check whether my variable value returned matches with:

https://maps.googleapis.com/maps/api/streetview

lin
  • 17,405
  • 4
  • 54
  • 82
rubyist
  • 2,998
  • 7
  • 35
  • 64

1 Answers1

0

ES6

str.startsWith('https://maps.googleapis.com/maps/api/streetview');

ES5

str.indexOf('https://maps.googleapis.com/maps/api/streetview') === 0
Aurelien Ribon
  • 7,408
  • 2
  • 40
  • 53