Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to use capital and small letter ?

Posted on 2010-09-03
6
Medium Priority
?
228 Views
Last Modified: 2012-06-27

Hi ,
I have some  search condition a,e,i,o,u

iN search screen user enter sathish as search word means  , I check with search condition if any letter which is enter by user is equal means then  

the i pass the search word as  sathish,sAthish this 2 words

if it not match means  pass same value sathish

I am try in hashMap but i cant get the correct solution can any one give an idea

how to achive this ??
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 33594304
if the user enter sathise means
 
passing parameter is sathishe,sAthishE
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 33594323
sorry typo error h i wrongly enter
sathise ,sAthisE
0
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 33594619
Please rephrase the question a little bit in terms of, if user enters sathish, what should happen?

If you are looking for case-insensitive search, then by simply converting the query text and the text to be searched, you can get the desired results
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 33595030
If you senter some value for search means then that word will goto  DB to search the word present or not .
They(user) have some search condition .
that condition is a,e,i,o,u this letter present in ur search word means  you have change that in to  Caps(that particular word only) and pass both words ,
if it not not match means send same word

if the user enter sathishe means
 
passing parameter is sathishe,sAthishE (here a,e is there in condition so covert to caps and we pass both)
 if the user enter nsk means
 
passing parameter is nsk
 
I think you understand my condition
 
0
 
LVL 4

Expert Comment

by:msk_apk
ID: 33595880
You can have the user to select their search is case sensitive or case insensitive. if its case sensitive, then its enough to maintain only one hashmap. user's input and your storage should follow the same syntax i.e no formatting is needed at all. Likewise you need to maintain case insensitive hashmap where store the keys with either lowercase or uppercase after formatting the raw input. Same transformation has to be made when the user is giving the input. i.e either it has to be changed to lowercase or uppercase.

0
 
LVL 20

Accepted Solution

by:
Sathish David  Kumar N earned 0 total points
ID: 33596424
some what like this code ....
HashMap specialChar= new HashMap();
		String s1="";
		String s2="";
		for(int i=0;i<s.length();i++)
		{
			
			
			boolean e=specialChar.containsKey( Character.toString(s.charAt(i)));
			
			if(e==true)
			{
				String g =(specialChar.get(Character.toString(s.charAt(i)))).toString();
				
				String[] sp=g.split(",");
				s1=s1+sp[0];
				s2=s2+sp[1];
			
			}
			if(e==false)
			{
				s1=s1+Character.toString(s.charAt(i));
				s2=s2+Character.toString(s.charAt(i));
			}
		
		}
		  System.out.println(s);
		  System.out.println(s1);
		  System.out.println(s2);
		  
		return s1+","+s2;

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question