android转换string
① android开发中如何讲一个list数组转换成String字符串的形式
public class SplitTest {
public static void main(String args[]) {
String str = "a1.png,a2.png,a3.png";// 原始字符串
String[] arrayStr = new String[] {};// 字符数组
List<String> list = new ArrayList<String>();// list
arrayStr = str.split(",");// 字符串转字符数组
list = java.util.Arrays.asList(arrayStr);// 字符数组转list
String[] storeStr = list.toArray(new String[list.size()]);// list转成字符数组
/* 输出字符数组的值 */
for (String s : arrayStr) {
System.out.println(s);
}
System.out.println("-------------");
/* 输出list值 */
for (String s : list) {
System.out.println(s);
}
System.out.println("-------------");
for (String s : storeStr) {
System.out.println(s);
}
System.out.println("-------------");
}
}
② android字符串转换成16进制怎么转
android字符串转换成16进制,参考如下内容:
/**
* 字符串转换成十六进制字符串
* @param String str 待转换的ASCII字符串
* @return String 每个Byte之间空格分隔,如: [61 6C 6B]
*/
public static String str2HexStr(String str)
{
char[] chars = "0123456789ABCDEF".toCharArray();
StringBuilder sb = new StringBuilder("");
byte[] bs = str.getBytes();
int bit;
for (int i = 0; i < bs.length; i++)
{
bit = (bs[i] & 0x0f0) >> 4;
sb.append(chars[bit]);
bit = bs[i] & 0x0f;
sb.append(chars[bit]);
sb.append(' ');
}
return sb.toString().trim();
}
③ Android 怎样将amr音频文件转换成String
下载一个 格式工厂
这个事网站:https://www..com/index.php?tn=56060048_4_pg&ch=12#wd=%E6%A0%BC%E5%BC%8F%E5%B7%A5%E5%8E%82&rsv_spt=1&rsv_iqid=0x9ffe789500019b61&issp=1&f=8&rsv_bp=0&rsv_idx=2&ie=utf-8&tn=56060048_4_pg&rsv_enter=0&rsv_sug3=2&rsv_sug1=1&inputT=5674&rsv_sug4=7147