string뒤집기

문자열을 뒤집고 싶다. ex) "coffee" → "eeffoc" StringBuffer의 reverse() 메서드 사용 StringBuffer를 사용해서 문자를 뒤집을 수 있다. import java.io.IOException; public class Receipt_25304 { public static void main(String args[]) throws IOException { String str = "coffee"; StringBuffer cReverse = new StringBuffer(str); String reverseStr = cReverse.reverse().toString(); System.out.println("원래 :" + str); System.out.println("뒤집기 :..
해버니
'string뒤집기' 태그의 글 목록