[ create a new paste ] login | about

Link: http://codepad.org/Ald1l9vb    [ raw code | fork ]

C, pasted on Aug 8:
1
2
3
4
5
6
7
8
9
10
11
12
public class test {
public static void main(String[] args) throws Exception {
		
		String test = "0123456";
		puts("%s length %d", test, test.length());
		
		for (int i=1; i <= test.length(); i++)
			puts("prefix [%d, %d] -> %s", 1, i, test.substring(0, i));
}
	public static void puts(String s){ System.out.println(s); }
	public static void puts(String format, Object... args){ puts(String.format(format, args)); }
}


Create a new paste based on this one


Comments: