void setup() {
size(200, 200);
background(2);
String a = "Computer";
textSize(20);
text("Reverse : "+reverse(a), 10, 100);
}
String reverse(String C) {
String B = "";
int i=0;
while (i<C.length ()) {
char j=C.charAt(C.length()-1-i);
B=B+j;
i=i+1;
}
return B;
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น