How do i make 2 strings appear the same?

I have asked another question earlier but somehow i am not able to make 2 string orders exactly similar.
Smith | Steve | D | M | Red | 3-3-1985
Hingis Martina Female 4/2/1979 Green

how do i make the first string look like the second string...i need a way which works universally.
ravivanjaniAsked:
Who is Participating?
 
ManishConnect With a Mentor LeadCommented:
If first string always in this format,
split first string using split method, and arrange them as per
down string
0
 
CEHJCommented:
I would use a regex to determine which format is which: let's call them 1 and 2
0
 
CEHJConnect With a Mentor Commented:

boolean formatOne = line.matches(".+-\\d{4}$");
if (formatOne) {
     // Make into formatTwo by splitting and rearranging array
}

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.