Skip to content

Instantly share code, notes, and snippets.

@honux77
Created July 16, 2014 03:48
Show Gist options
  • Select an option

  • Save honux77/28dd29f723e3ea1c9192 to your computer and use it in GitHub Desktop.

Select an option

Save honux77/28dd29f723e3ea1c9192 to your computer and use it in GitHub Desktop.
java string format
import java.util.Calendar;
public class StringTest {
public static void formatTest() {
Calendar c = Calendar.getInstance();
String strtest = String.format("안녕하세요 %d월 %d일입니다.",
c.get(Calendar.MONTH) + 1, c.get(Calendar.DAY_OF_MONTH));
System.out.println(strtest);
}
public static void main(String[] args) {
StringTest.formatTest();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment