Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners indexof case insensitive java

Have Programming Question? Ask it here!
 
 
 


Deepak Kumar
indexof case insensitive java
1 Answer(s)      3 years and 4 months ago
Posted in : Java Beginners


Hi,

I have to use the indexOf function on String class in Java. I am looking for indexof case insensitive java example. Share the code with me.

Thanks


Advertisement
View Answers

March 24, 2011 at 1:16 AM


Hi,

You can convert both the string into lowercase and then use indexOf method as shown below:

String s1 = str1.toLowerCase(Locale.US);
String s2 = str2.toLowerCase(Locale.US);
if(s1.indexOf(s2)!=-1){
  System.out.println("String found");
}else{
  System.out.println("String not found");
}

Thanks



Related Tutorials/Questions & Answers:
indexof case insensitive java
indexof case insensitive java  Hi, I have to use the indexOf function on String class in Java. I am looking for indexof case insensitive java... the string into lowercase and then use indexOf method as shown below: String s1
Hibernate Criteria Case Insensitive Search.
Hibernate Criteria Case Insensitive Search.  How to use Case Insensitive Search in Hibernate?   The Case Insensitive ignores the case... class Employee.java‚??Hibernate uses the Plain Old Java Object (POJO) classes
Advertisements
Hibernate Criteria Case Insensitive
Hibernate Criteria Case Insensitive The Case Insensitive ignores the case of  the latter. It Selects all the records of the table related to the given... = criteria.list(); An example of Case insensitive is given below please consider
Case-insensitive ordering using Hibernate Criteria.
Case-insensitive ordering using Hibernate Criteria.  What is Case-insensitive ordering in Hibernate Criteria
Case-insensitive equals using Hibernate Criteria.
Case-insensitive equals using Hibernate Criteria.  How to use Case-insensitive equals with Hibernate Criteria?   The Case Insensitive ignores the case of the latter. It Selects all the records of the table related
Case-insensitive search using Hibernate Query Language(HQL).
Case-insensitive search using Hibernate Query Language(HQL).  What is Case-insensitive search using Hibernate Query Language
Java GUI IndexOf - Java Beginners
Java GUI IndexOf  Hello and thank you for having this great site. Here is my problem. Write a Java GUI application called Index.java that inputs several lines of text and a search character and uses String method indexOf
Java ArrayList indexof() Method
. If no element is present then returns the -1. Example of Java Arraylist indexof() Function import†java.util.*; public†class†List1†{ public
String indexOf() method in Java
String indexOf() method in Java In this tutorial we will discuss about indexOf() method in java. indexOf() method which is of string class,  used... for searching a specified character or string, indexOf() and lastIndex(). For example
Java is case sensitive
Java is case sensitive  hello, Why Java is case sensitive?   hii, Java is Platform Independent Language, so its used widely in very big... that huge no of variables,Java is Case Sensitive
Switch Case - Java Interview Questions
Switch Case  int x=100000; switch(x) { case 100000: printf("Lacks"); } output= Lacks I want reason why x matches switch case although range for int is in between something -32678 to +32676. Plz give me ans quickly
Case Java Keyword
Case Java Keyword      ... statement in java program. In other word Case is a java keyword... programming statement case block will not have the implicit ending point. At java
Java : String Case Conversion
Java : String Case Conversion In this section we will discuss how to convert a String from one case into another case. Upper to Lower case Conversion : By using toLowerCase() method you can convert any upper case char/String
Java String Case Converter
Java String Case Converter Here we are going to convert lowercase characters to upper case and upper case characters to lower case simultaneously from the given input string. Description of code: Through the following code, we have
indexOf(Objekt o)
indexOf(Objekt o)  I have created a class, which contains 3 parameters; "l", "es1", "es2" public T(float l, float es1, float es2) { } I would then like to create a method, which returns me the index of a specific object
How to integrate IBM case Manager with Java Applicarion(JSP or core java)
How to integrate IBM case Manager with Java Applicarion(JSP or core java)  Dear All, Its really important for me to demonstrate a POC (Proof of Concept) on integrating IBM Case Manager with Java Application. Any small help
JavaScript indexOf substring
JavaScript indexOf substring... the JavaScript method indexOf(). When this method is called from the string object...: <html> <h2>Use of indexOf() method</h2> <script
Switch Case in Java
. Switch statements with String cases are supported in Java SE 7 but the earlier version of Java did not support String in switch/case. Switch statements works... case will take place. Example of Switch Statement in Java: import java.io.
String indexOf() Method
String indexOf() Method      ... the indexOf() method of String class. We are going to use indexOf() method of String class in Java. The description of the code is given below for the usage
Switch case in java
Switch case in java In this section we will learn about switch case in java..., and java, switch case is used . switch  is a selection control mechanism used... will illustrate the use of switch case in java: import java.util.Scanner; public
Write a java program to display the season given the month using switch case
Write a java program to display the season given the month using switch case  Write a java program to display the season given the month using switch case
String indexOf(String str)
about the indexOf(String str) method through the following java program... String indexOf(String str)     ... the indexOf(String str) method of String class. We are going to use indexOf(String str
String indexOf(int ch)
the indexOf(int ch) method through the following java program. In the program... String indexOf(int ch)      ... the indexOf(int ch) method of String class. We are going to use indexOf(int ch
How to trim string till indexof the string
How to trim string till indexof the string  how to trim string till indexof the string
Hibernate Query Language
query language. HQL is much like SQL  and are case-insensitive, except for the names of the Java Classes and properties. Hibernate Query Language is used
test case
test case  Hi Can you explain me how to write test case in java. regards kennedy
jsf command link navigation case - Java Server Faces Questions
jsf command link navigation case  Hi, in my jsf page i have 2 commandlink tags,then how to write navigation case in faces config.xml tell me as soon... in JSF : "navigation case in faces-config.xml
Matching Case
Matching Case  Hi, i want some code for matching case from an text file. i.e if i give an query called Java from the user,i need to get an output searching the text file all the names in that without case sensitive
Character Cases Ignoring case sensitiveness in java
Character Cases Ignoring case sensitiveness in java... to compare two strings ignoring case sensitiveness  Java provides the method... CharCompIgnoreCase.java C:\vinod\Math_package>java CharCompIgnoreCase
Business case
Business case  hii, For which phase of RUP the "business case" for the project established ?   hello, Inception phase of RUP the "business case" for the project established
switch case
switch case  program to input 2 numbers and a choice.Using switch case we need to perform all the mathematical operation.Print a suitable error message if the choice is wrong
switch case
switch case  program to input 2 numbers and a choice.Using switch case we need to perform all the mathematical operation.Print a suitable error message if the choice is wrong
String indexOf(int ch, int fromIndex)
about the indexOf(int ch, int fromIndex) method of String class. We are going to use indexOf(int ch, int fromIndex) method of String class in Java... String indexOf(int ch, int fromIndex)   
String indexOf(String str, int fromIndex)
explanation about the indexOf(String str, int fromIndex) method of String class. We are going to use indexOf(String str, int fromIndex) method of String class in Java... String indexOf(String str, int fromIndex)   
case study
case study  Chocolate Manufacturer Case Study CDA Company is in the business of manufacturing chocolates. The company delivers various chocolate products like- chocolate bars ,chocolate powder ,chocolate gift box and chocolate
switch case instead of if else
switch case instead of if else  How to write code in switch case instead of if else in Java
String indexOf method example
.style1 { font-size: medium; } String indexOf() method example:- String class method indexOf() is use to find the starting character position of the substring from the string. The indexOf() method start to search from
uisearchbar case sensitive
uisearchbar case sensitive  uisearchbar case sensitive
Use of <fn:indexOf(String, String)> Tag of JSTL
Use of <fn:indexOf(String, String)> Tag of JSTL... as arguments and returns int type.   Syntax : int indexOf(java.lang.String, java.lang.String) indexOf_fnJstlTag.jsp
UML CASE Tools
UML CASE Tools  What requirements should a UML CASE tool meet
XML case-sensitive
XML case-sensitive  Hi please anyone tell me Which parts of an XML document are case-sensitive? Thanks
Setting Case Sensitivity in a Regular Expression
is used for setting the pattern case insensitive because the pattern is by default... Setting Case Sensitivity in a Regular Expression  ... the patter is either case sensitive or not. Actually, by default the patter
XML is case-sensitive
XML is case-sensitive  hello, can some body can tell me that Is XML case-sensitive or not ?   HELLO MAN, YEAH, XML IS A CASE SENSITIVE LANGUAGE
CASE IN UPDATE IN MYSQL
CASE IN UPDATE IN MYSQL  I WANT THE SYNTAX FOR USING CASE IN UPDATE STMT IN MYSQL.ANY ONE PLEASE HELP.   Hi Friend, Visit here Thanks
Mysql Lower Case
Mysql Lower Case       Mysql Lower Case is used to convert the Upper Case letter to the Lower Case... 'Mysql Lower Case. To understand this example we create a table 'employee1
Mysql Lower Case
Mysql Lower Case       Mysql Lower Case is used to convert the Upper Case letter to the Lower Case. Understand With Example The section of this Tutorial illustrate
using case in update statement
using case in update statement  i want to use case in update clause. i have used case in select stmt referring answer in this site. but the same syntax is not working for update stmt.my problem is update emp set case deptno
Switch case + condition??
Switch case + condition??  I try to use a switch case with condition...(down.getSelectedIndex()) { case 0: Tambo(); if( label.equals...")){ search();} break; case 1: Nyqeni
 

 

 

DMCA.com