delete Last Char from StringBuilder - Java java.lang

Java examples for java.lang:StringBuilder

Description

delete Last Char from StringBuilder

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        StringBuilder sb = new StringBuilder();
        deleteLastChar(sb);//from ww  w .ja v  a 2 s.  co m
    }

    public static void deleteLastChar(StringBuilder sb) {
        sb.deleteCharAt(sb.length() - 1);
    }
}

Related Tutorials