Skip to main content
comments
Source Link
worldofjr
  • 3.9k
  • 8
  • 41
  • 53

One option is to use regular expressions:

if (str.match("^Hello")) { // ...do this if begins with Hello } if (str.match("World$")) { // ...do this if ends in world } 

One option is to use regular expressions:

if (str.match("^Hello")) { // ... } if (str.match("World$")) { // ... } 

One option is to use regular expressions:

if (str.match("^Hello")) { // do this if begins with Hello } if (str.match("World$")) { // do this if ends in world } 
Rollback to Revision 1
Source Link
worldofjr
  • 3.9k
  • 8
  • 41
  • 53

One option is to use regular expressions:

 /* START with 'Hello' */ if (str.match("^Hello")) {   // ...  }    /* END with 'World' */ if (str.match("World$")) {   // ...  } 

One option is to use regular expressions:

 /* START with 'Hello' */ if (str.match("^Hello")) {   // ...  }    /* END with 'World' */ if (str.match("World$")) {   // ...  } 

One option is to use regular expressions:

if (str.match("^Hello")) { // ... } if (str.match("World$")) { // ... } 

One option is to use regular expressions:

 /* START with 'Hello' */ if (str.match("^Hello")) {   // ...  }    /* END with 'World' */ if (str.match("World$")) {   // ...  } 

One option is to use regular expressions:

if (str.match("^Hello")) { // ... } if (str.match("World$")) { // ... } 

One option is to use regular expressions:

 /* START with 'Hello' */ if (str.match("^Hello")) {   // ...  }    /* END with 'World' */ if (str.match("World$")) {   // ...  } 
Source Link
Lukáš Lalinský
  • 41.5k
  • 6
  • 109
  • 128
Loading