Solved

How do i make 2 strings appear the same?

Posted on 2009-04-14
4
181 Views
Last Modified: 2012-05-06
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
Comment
Question by:ravivanjani
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
Manish earned 250 total points
ID: 24145031
If first string always in this format,
split first string using split method, and arrange them as per
down string
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24146538
I would use a regex to determine which format is which: let's call them 1 and 2
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 250 total points
ID: 24146561

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

Open in new window

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
javap bin 2 41
fibonacci ten numbers 4 46
How to convert from xls to xlsx using java 7 57
Bot application - advice 3 39
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video teaches viewers about errors in exception handling.

820 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