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,956
  • 4
  • 59
  • 83
rubyist
  • 3,074
  • 8
  • 37
  • 69

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,548
  • 3
  • 43
  • 54