on 04-28-2008 12:25 PM
Hi,
I am doing one application . In that i have to enter substrubg in search user inputfield and then i click on search . Not i want to show all user which contain that substring . So please guide in that.
Example...
Like i am writing "ab*" then all users comes which contain ab substring.
Regards,
Gurprit Bhatia
Using "ab*" as a search pattern suggests searching for all strings starting with "ab" not for strings containing "ab".
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this logic.
String searchString="ab*";
searchString=searchString.subString(0,searchString.length-2);
String[] matchedArray=new matchedArray(100);
int j=0;
//Let your compare strings be in an array strArray
for(int i=0;i<strArray.length;i++){
String temp=strArray<i>.subString(0,searchString.length-2);
if(temp.equals(searchString)){
matchedArray[j]=strArray<i>;
j++;
}
}
Then display the matched String array.
Hope it helps.
Regards,
Srinivasan Subbiah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
String searchString="ab*";
searchString=searchString.subString(0,searchString.length-2);
String[] matchedArray=new String[100];
int j=0;
//Let your compare strings be in an array strArray
for(int i=0;i<strArray.length;i++){
if(strArray<i>.contains(searchString)){
matchedArray[j]=strArray<i>;
j++;
}
}
Regards
Ayyapparaj
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.