public class MyString{
public static String rTrim(String s){
int len = s.length();
int st = 0;
int off = 0; /* avoid getfield opcode */
char[] val = s.toCharArray(); /* avoid getfield opcode */
public static String lTrim(String s){
int len = s.length();
int st = 0;
int off = 0; /* avoid getfield opcode */
char[] val = s.toCharArray(); /* avoid getfield opcode */
先看看trim()这个方法的实现
public String trim() {
int len = count;
int st = 0;
int off = offset; /* avoid getfield opcode */
char[] val = value; /* avoid getfield opcode */