Solved

How do i make 2 strings appear the same?

Posted on 2009-04-14
4
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet example 11 73
Notify sent to other threads in Java 9 52
Java basic valueOf question 1 46
Java array sort 10 59
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

738 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