I have two String Arrays and want to create key-value pairs. To build that I use value from first array and need to search for wild-card string on the second array.
My first array contains date×tamp and second array contains list of files and files names embeds dataTimestamp.
So, from first array for every value I need to search file names in second array and if I find matching value in
second array then I will be creating key-value pairs i.e array-of-array [ ] [ ].
This is how values in first and second array will look like. I can sort first array, but sort values for second array
will not be same sequence with first array. Hence, I need to search. Both are String Arrays.
Value from first array:
Value from second array
int index = Arrays.binarySearch(sortedArray, "*20070521104242689");
is not working for wild-card search.
Can anyone please help.
This topic has been locked.
1 reply Latest Post - 2007-06-13T15:37:05Z by nagkumar
Pinned topic How to perform Wild-card search in String Array?
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2007-06-13T15:37:05Z at 2007-06-13T15:37:05Z by nagkumar
nagkumar 120000NBPN3 PostsACCEPTED ANSWER
Re: How to perform Wild-card search in String Array?2007-06-13T15:37:05Z in response to SystemAdminHi,
You could iterate over the second array and use regular expression RegEx package to see if the array value matches.
In fact Arrays class would internally does the interation on all the array elements.
Raja Nagendra Kumar,
Competant and Reliable Offshore Code Varification Partners.