I am getting some value in JSON response. These some time contains hyphen '-'. So in javascript '-' hyphen treated as a subtraction.
JSON
books": {
"red": "2008-17801",
"blue": "TERTERIAN-HAYK"
}
After getting these values I am putting into the array.
LIKE
["2008-17801"]
["TERTERIAN-HAYK"]
But before the assigning I want to check value has hyphen'-' or not. I checked one link, But it is checking all special characters. jQuery: Check if special characters exists in string.
I want to check only hyphen.