//android后台Java //ASCII加密 String str = e.getText().toString(); StringBuilder s = new StringBuilder(); char[] c = str.toCharArray(); for (int i = 0; i < str.length(); i++) { int a = c[i]; a = a + 7; s.append((char) a) ; } //ascll解密一// String d = "&
public class CharToAscii { public static void main(String[] args) { CharToAscii.AscToString(); CharToAscii.StringToAsc(); char a = '0'; int b = 22307; //char类型参与四则运算的时候是转化成asciii码的, 字符‘0’的ascii码为48,要转换成int型,只需要(‘0’-48)即可 System.out.println(a-48); Sys
转自:http://blog.csdn.net/linfeng999/article/details/6661233 1. 构造字符串 直接构造 STR_ZERO=hello #shell中等号左右的空格不能随便加,如果写作STR_ZERO = hello,linux会认为STR_ZERO是一个命令而执行出错 STR_FIRST="i am a string" STR_SECOND='success' USER_NAME='world' 重复多次 #repeat the first p