Solved

How to use capital and small letter ?

Posted on 2010-09-03
6
219 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
  • 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:gurvinder372
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Performance issue while iterating with streams 5 39
factorial example challenge 10 62
mapBully challenge 6 89
recursion example 16 69
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now