Skip to content

Instantly share code, notes, and snippets.

@ishaquehassan
Created March 27, 2017 15:57
Show Gist options
  • Save ishaquehassan/c425de7cac81c3b451d327aa4c991701 to your computer and use it in GitHub Desktop.
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()
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