• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

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.
0
ravivanjani
Asked:
ravivanjani
  • 2
2 Solutions
 
ManishLeadCommented:
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
 
CEHJCommented:

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

Open in new window

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now