Created
March 27, 2017 15:57
-
-
Save ishaquehassan/c425de7cac81c3b451d327aa4c991701 to your computer and use it in GitHub Desktop.
A Simple Method to make System.out.println() works like C#'s Console.writeLine()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void consoleWriteLine(String message, Object... data){ | |
if(message.contains("{0}") && data.length > 0){ | |
int di = 0; | |
for(Object o : data){ | |
message = message.replace("{"+di+"}",String.valueOf(o)); | |
di++; | |
} | |
} | |
System.out.println(message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment