To find “hello” in your_string
if (your_string.indexOf('hello') > -1)
{
alert("hello found inside your_string");
}
For the alpha numeric you can use a regular expression:
More Related Contents:
- Regular expression to get a string between two strings in Javascript
- What are valid Date Time Strings in JavaScript?
- Are JavaScript strings immutable? Do I need a “string builder” in JavaScript?
- Replace multiple strings with multiple other strings
- Regular Expression to get a string between parentheses in Javascript
- Insert a string at a specific index
- Is there a way to create a function from a string with javascript?
- Capitalize words in string [duplicate]
- Replace multiple whitespaces with single whitespace in JavaScript string
- Why does “true” == true show false in JavaScript?
- Is there a JavaScript function that can pad a string to get to a determined length?
- How do I check if string contains substring? [duplicate]
- What does ${} (dollar sign and curly braces) mean in a string in JavaScript?
- How to insert variables in JavaScript strings?
- JavaScript replace() method dollar signs
- How can I use jQuery to style /parts/ of all instances of a specific word?
- Is there a JavaScript strcmp()?
- How can I insert new line/carriage returns into an element.textContent?
- How to extract a string using JavaScript Regex?
- What’s the point of new String(“x”) in JavaScript?
- How to remove part of a string?
- Javascript unicode string, chinese character but no punctuation
- JavaScript adding a string to a number
- Extract the text out of HTML string using JavaScript
- What is the difference between ‘ and ” in JavaScript?
- Replace spaces with dashes and make all letters lower-case
- Why are there two kinds of JavaScript strings?
- Print / display a JavaScript variable’s name instead of it’s value
- How to count the number of lines of a string in javascript
- Does jQuery strip some html elements from a string when using .html()?