Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Object[] arguments = {
- new Integer(7),
- new Date(System.currentTimeMillis()),
- "a disturbance in the Force"
- };
- String result = MessageFormat.format(
- "At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.",
- arguments);
- output: At 12:30 PM on Jul 3, 2053, there was a disturbance
- in the Force on planet 7.
- C:oreyessamplesjavareplace>type Simplistic.java
- public class Simplistic{
- public static void main( String [] args ) {
- String template = "Dear _NAME_HERE_. I'm glad you...";
- System.out.println( template.replaceAll("_NAME_HERE_","Oscar Reyes"));
- }
- }
- C:oreyessamplesjavareplace>java Simplistic
- Dear Oscar Reyes. I'm glad you...
Add Comment
Please, Sign In to add comment