char swap; for (int i = 0; i < half; i++) { swap = buf[i]; buf[i] = buf[size - i]; buf[size - i] = swap;
for (int leftIdx = 0, rightIdx = size - 1; leftIdx < half; leftIdx++,rightIdx--) { char swap = buf[leftIdx]; buf[leftIdx] = buf[rightIdx]; buf[rightIdx] = swap;
    public StrBuilder reverse() {        int half = size / 2;        char swap;        for (int i = 0; i < half; i++) {            swap = buf[i];            buf[i] = buf[size - i];            buf[size - i] = swap;        }        return this;    }