mnbn.net
当前位置:首页 >> ArrAyBuFFEr转字符串 >>

ArrAyBuFFEr转字符串

StringBuffer s_buffer = new String(字符串); String s_string = new StringBuffer(字符串).toString();

可以用数组的字符串拼接函数join(),例如 var arr = ["12", "34", "56"]; alert(arr.join("")); // join的参数是分隔符

function char2buf(str){ var out = new ArrayBuffer(str.length*2); var u16a= new Uint16Array(out); var strs = str.split(""); for(var i =0 ; i

function char2buf(str){ var out = new ArrayBuffer(str.length*2); var u16a= new Uint16Array(out); var strs = str.split(""); for(var i =0 ; i

function char2buf(str){var out = new ArrayBuffer(str.length*2);var u16a= new Uint16Array(out);var strs = str.split("");for(var i =0 ; i

function char2buf(str){ var out = new ArrayBuffer(str.length*2); var u16a= new Uint16Array(out); var strs = str.split(""); for(var i =0 ; i

StringBuffer s_buffer = new String(字符串); String s_string = new StringBuffer(字符串).toString();

functionchar2buf(str){ varout=newArrayBuffer(str.length*2); varu16a=newUint16Array(out); varstrs=str.split(""); for(vari=0;i

function char2buf(str){ var out = new ArrayBuffer(str.length*2); var u16a= new Uint16Array(out); var strs = str.split(""); for(var i =0 ; i

字符串变为数组,最笨的方法是str.split('')分隔方法。如:var arr=str.split(',');以逗号分隔字符,结果为数组。其他方法可能就要遍历字符串的字符了。

网站首页 | 网站地图
All rights reserved Powered by www.mnbn.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com