public static int delete(char target[], int limit, int offset16) {
        int count = 1;
        switch (bounds(target, 0, limit, offset16)) {
        case LEAD_SURROGATE_BOUNDARY:
            count++;
            break;
        case TRAIL_SURROGATE_BOUNDARY:
            count++;
            offset16--;
            break;
        }
        System.arraycopy(target, offset16 + count, target, offset16, limit - (offset16 + count));
        target[limit - count] = 0;
        return limit - count;
    }
public static int delete ( char target [ ] , int limit , int offset16 ) { int count = 1 ; switch ( bounds ( target , 0 , limit , offset16 ) ) { case LEAD_SURROGATE_BOUNDARY : count ++ ; break ; case TRAIL_SURROGATE_BOUNDARY : count ++ ; offset16 -- ; break ; } System . arraycopy ( target , offset16 + count , target , offset16 , limit - ( offset16 + count ) ) ; target [ limit - count ] = 0 ; return limit - count ; }
Removes the codepoint at the specified position in this target (shortening target by 1
character if the codepoint is a non-supplementary, 2 otherwise).

@param target String buffer to remove codepoint from
@param limit End index of the char array, limit &lt;= target.length
@param offset16 Offset which the codepoint will be removed
@return a new limit size
@exception IndexOutOfBoundsException Thrown if offset16 is invalid.