Solved

How do i make 2 strings appear the same?

Posted on 2009-04-14
4
180 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cipher Configuration on Apache HTTPD 4 63
web services creation SOAP vs REST 5 42
table example 4 29
What's wrong with this code? 4 23
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This video teaches viewers about errors in exception handling.

810 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