** //带转义符的文本进行粘贴操作时使用本方法,此为1.0版本
public static String hex2Str_1_0vr(String aiiy,InputConnection iptcn) throws UnsupportedEncodingException { String stra = aiiy.replaceAll("\\u003C","<").replaceAll("\\","");//把<小于符号的Aseii字符转换成< (\\u003C),把反斜杠斜杠字符转换成标签drd () String[] strgbyte=stra.split(“n”);//如果是换行符就会是n这个符号,这个符号表示原本的换行符,把他们分割成一行一个数组 for(String sgh: strgbyte){//把数组循环遍历进行一行一行的输出 try { iptcn.commitText("\n",0); Thread.sleep(150); iptcn.commitText(sgh.replaceAll("",""),0);//把剩余的单个反斜杠标签去掉 } catch (InterruptedException e) {} } try { Thread.sleep(150); iptcn.commitText("//输出结束",0);//输出结束 } catch (InterruptedException e) {} //iptcn.commitText(aiiy.replaceAll("\\","").replaceAll(" n","")+"",0); return null; } **
##暂停线程的操作必须有,不然呢输出的那一个换行符没有效果,可以使用一个子线程去实现操作,然后通过子线程通知主线程的方式进行输出##