-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpracticeReplace.java
More file actions
54 lines (51 loc) · 1.93 KB
/
practiceReplace.java
File metadata and controls
54 lines (51 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* Copyright (c) 2014 CA. All rights reserved.
*
* This software and all information contained therein is confidential and
* proprietary and shall not be duplicated, used, disclosed or disseminated
* in any way except as authorized by the applicable license agreement,
* without the express written permission of CA. All authorized reproductions
* must be marked with this language.
*
* EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO THE EXTENT
* PERMITTED BY APPLICABLE LAW, CA PROVIDES THIS SOFTWARE WITHOUT
* WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED
* WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN
* NO EVENT WILL CA BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY
* LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS SOFTWARE,
* INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION,
* GOODWILL, OR LOST DATA, EVEN IF CA IS EXPRESSLY ADVISED OF SUCH LOSS OR
* DAMAGE.
*/
package practice1;
/**
* DOCUMENT ME!
*/
public class practiceReplace
{
/**
* DOCUMENT ME!
*
* @param args DOCUMENT ME!
*/
public static void main(String[] args)
{
String s =
"&[page] of &[pages] || &[pages] of &[page]|| i am madd || on date is &[date] &time is &[time] || on date is &[time] &time is &[date] ";
s = s.replace("&[page]", "01");
s = s.replace("&[pages]", "10");
s = s.replace("&[date]", "19/04/1990");
s = s.replace("&[time]", "09:53AM");
s = s.replace("alu", "pyaaz");
s = s.replace("&[paged]", "01");
System.out.println(s);
/*DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm");
Date date = new Date();
String dateTime = dateFormat.format(date);
String currdate = dateTime.substring(0, 10);
String currtime = dateTime.substring(11);
System.out.println(dateTime);
System.out.println(currdate);
System.out.println(currtime);*/
}
}