Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

making a new string from old string

user575089Dec 13 2016 — edited Jan 17 2017

I have two String .

String str1="01/12/2016" 

I want to convert into another String str2="20161201"

One way I can think of is to split the string and then append from backwards to generate this new string.  Is there any easy  way one can make it ?

and ...

String str3="13/12/2016" 

I want to convert into another string str4="20161214"

I can think of it as split and then add like this ...

"2016"+"12"+  "convert to integer (13) + 1"

Is there any easy  way one can make it ?

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 14 2017
Added on Dec 13 2016
6 comments
357 views