1.最容易想到的估计就是利用String类的toCharArray(),再倒序输出数组的方法了: package himi.hebao05; public class TestDemo02 { public static void main(String[] args) { int i = 0; String text = "hebao I love you!"; String result = " "; char[] charArray = text.toChar…
由于项目上有需求要求输入银行卡号四位一空格的需求,改过好几版发现都有bug,最后优化了一版看起来效果还行,发帖留存. 难点是从中间插入和删除处理光标问题. 首先需要用到获取光标和设置光标的方法. // 获取光标位置 function getCursortPosition(textDom) { var cursorPos = 0; if (document.selection) { // IE Support textDom.focus(); var selectRange = document.…
Base64 报错 的解决办法, 报错如下:1. FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters. ] System.Convert.FromBase64Str…