下面的例子是在文件的指定位置增加指定字符串的例子 修改配置文件: def add_str(pre_str): lines = [] flag = True f = open("z.txt") for line in f: lines.append(line) if line.strip("\n ") == "</se.diabol.jenkins.pipeline.DeliveryPipelineView>" and flag: li
1.获取光标位置 int index = editText.getSelectionStart(); 2.在光标处插入字符 int index = editText.getSelectionStart(); Editable editable = editText.getText(); editable.insert(index, "aaaa"); 3.删除光标前字符 int index = editText.getSelectionStart(); Editable editable