public UndoableEdit insertString(int where,String str) throws BadLocationException {
  if (where > length() || where < 0) {
    throw new BadLocationException("Invalid insert",length());
  }
  char[] chars=str.toCharArray();
  replace(where,0,chars,chars.length);
  return new InsertUndo(where,str.length());
}

public UndoableEdit insertString ( int where , String str ) throws BadLocationException { if ( where > length ( ) || where < 0 ) { throw new BadLocationException ( "Invalid insert" , length ( ) ) ; } char [ ] chars = str . toCharArray ( ) ; replace ( where , 0 , chars , chars . length ) ; return new InsertUndo ( where , str . length ( ) ) ; }
inserts a string into the content .
