Skip to main content
added 26 characters in body
Source Link
user757095
user757095

I think you could use regular expressions:

this tests for shoes case insensitive. (match also "shoesprostore")

if (/shoes/i.test(ele.Department)) { } 

this tests for the word shoes case insensitive. (match only "shoes""Big Shoes" and "Small Shoes") (edit 4)

if (/\bshoes\b/i.test(ele.Department)) { } 

edit:

this tests for the words shoe and shoes case insensitive.

if (/\bshoes?\b/i.test(ele.Department)) { } 

\b : start and finish of a word

? : the previous character may or may not be present

i (after the sencond /) : case insensitive

look here for more http://www.w3schools.com/jsref/jsref_obj_regexp.asp

:)

edit 2:

corrected grammar inconsistencies thanks to my friend SandMan

edit 3:

maybe you could save the regex in global scope (before the $(document).ready(...) statement) using

var shoeTest = /shoes/i; then

if (shoeTest.test(...))

I think you could use regular expressions:

this tests for shoes case insensitive. (match also "shoesprostore")

if (/shoes/i.test(ele.Department)) { } 

this tests for the word shoes case insensitive. (match only "shoes")

if (/\bshoes\b/i.test(ele.Department)) { } 

edit:

this tests for the words shoe and shoes case insensitive.

if (/\bshoes?\b/i.test(ele.Department)) { } 

\b : start and finish of a word

? : the previous character may or may not be present

i (after the sencond /) : case insensitive

look here for more http://www.w3schools.com/jsref/jsref_obj_regexp.asp

:)

edit 2:

corrected grammar inconsistencies thanks to my friend SandMan

edit 3:

maybe you could save the regex in global scope (before the $(document).ready(...) statement) using

var shoeTest = /shoes/i; then

if (shoeTest.test(...))

I think you could use regular expressions:

this tests for shoes case insensitive. (match also "shoesprostore")

if (/shoes/i.test(ele.Department)) { } 

this tests for the word shoes case insensitive. (match "Big Shoes" and "Small Shoes") (edit 4)

if (/\bshoes\b/i.test(ele.Department)) { } 

edit:

this tests for the words shoe and shoes case insensitive.

if (/\bshoes?\b/i.test(ele.Department)) { } 

\b : start and finish of a word

? : the previous character may or may not be present

i (after the sencond /) : case insensitive

look here for more http://www.w3schools.com/jsref/jsref_obj_regexp.asp

:)

edit 2:

corrected grammar inconsistencies thanks to my friend SandMan

edit 3:

maybe you could save the regex in global scope (before the $(document).ready(...) statement) using

var shoeTest = /shoes/i; then

if (shoeTest.test(...))

added 179 characters in body
Source Link
user757095
user757095

I think you could use regular expressions:

this tests for shoes case insensitive. (match also "shoesprostore")

if (/shoes/i.test(ele.Department)) { } 

this tests for the word shoes case insensitive. (match only "shoes")

if (/\bshoes\b/i.test(ele.Department)) { } 

edit:

this tests for the words shoe and shoes case insensitive.

if (/\bshoes?\b/i.test(ele.Department)) { } 

\b : start and finish of a word

? : the previous character may or may not be present

i (after the sencond /) : case insensitive

look here for more http://www.w3schools.com/jsref/jsref_obj_regexp.asp

:)

edit 2:

corrected grammar inconsistencies thanks to my friend SandMan

edit 3:

maybe you could save the regex in global scope (before the $(document).ready(...) statement) using

var shoeTest = /shoes/i; then

if (shoeTest.test(...))

I think you could use regular expressions:

this tests for shoes case insensitive. (match also "shoesprostore")

if (/shoes/i.test(ele.Department)) { } 

this tests for the word shoes case insensitive. (match only "shoes")

if (/\bshoes\b/i.test(ele.Department)) { } 

edit:

this tests for the words shoe and shoes case insensitive.

if (/\bshoes?\b/i.test(ele.Department)) { } 

\b : start and finish of a word

? : the previous character may or may not be present

i (after the sencond /) : case insensitive

look here for more http://www.w3schools.com/jsref/jsref_obj_regexp.asp

:)

edit 2:

corrected grammar inconsistencies thanks to my friend SandMan

I think you could use regular expressions:

this tests for shoes case insensitive. (match also "shoesprostore")

if (/shoes/i.test(ele.Department)) { } 

this tests for the word shoes case insensitive. (match only "shoes")

if (/\bshoes\b/i.test(ele.Department)) { } 

edit:

this tests for the words shoe and shoes case insensitive.

if (/\bshoes?\b/i.test(ele.Department)) { } 

\b : start and finish of a word

? : the previous character may or may not be present

i (after the sencond /) : case insensitive

look here for more http://www.w3schools.com/jsref/jsref_obj_regexp.asp

:)

edit 2:

corrected grammar inconsistencies thanks to my friend SandMan

edit 3:

maybe you could save the regex in global scope (before the $(document).ready(...) statement) using

var shoeTest = /shoes/i; then

if (shoeTest.test(...))

added 2 characters in body
Source Link
user757095
user757095

I think you maycould use regular expressionexpressions:

this testtests for shoes case insensitive. (match also "shoesprostore")

if (/shoes/i.test(ele.Department)) { } 

this testtests for the word shoes case insensitive. (match only "shoes")

if (/\bshoes\b/i.test(ele.Department)) { } 

edit:

this testtests for the words shoe and shoes case insensitive.

if (/\bshoes?\b/i.test(ele.Department)) { } 

\b : stand for start and finish of a word

? : the previous character may or may not be present

i (after the sencond /) : case insensitive

look here for more http://www.w3schools.com/jsref/jsref_obj_regexp.asp

:)

edit 2:

corrected grammar inconsistencies thanks to my friend SandMan

I think you may use regular expression:

this test for shoes case insensitive. (match also "shoesprostore")

if (/shoes/i.test(ele.Department)) { } 

this test for the word shoes case insensitive. (match only "shoes")

if (/\bshoes\b/i.test(ele.Department)) { } 

edit:

this test for the words shoe and shoes case insensitive.

if (/\bshoes?\b/i.test(ele.Department)) { } 

\b : stand for start and finish of a word

? : the previous character may or may not be present

i (after the sencond /) : case insensitive

look here for more http://www.w3schools.com/jsref/jsref_obj_regexp.asp

:)

I think you could use regular expressions:

this tests for shoes case insensitive. (match also "shoesprostore")

if (/shoes/i.test(ele.Department)) { } 

this tests for the word shoes case insensitive. (match only "shoes")

if (/\bshoes\b/i.test(ele.Department)) { } 

edit:

this tests for the words shoe and shoes case insensitive.

if (/\bshoes?\b/i.test(ele.Department)) { } 

\b : start and finish of a word

? : the previous character may or may not be present

i (after the sencond /) : case insensitive

look here for more http://www.w3schools.com/jsref/jsref_obj_regexp.asp

:)

edit 2:

corrected grammar inconsistencies thanks to my friend SandMan

added 429 characters in body
Source Link
user757095
user757095
Loading
Source Link
user757095
user757095
Loading