Ho il seguente codice node.js:nodejs: la manipolazione delle stringhe
conn.on("data",function(x){
var responseData=x;
//sys.puts(responseData);
sys.puts(responseData.length);
var f=50;
var N=responseData.length;
if(N>f){
var p=Math.floor(N/f);
var p_rem=N%f;
var hash="";
for(var i=0;i<p;i++){
hash=DJBHash(responseData.substr(f*i,f)); //this line causes program to exit!
sys.puts(responseData.substr(f*i,f)+"***"+hash);
}
}
soc.write(x);
});
Ma substr non sembra funzionare!
Come posso ottenere sottostringhe di una stringa in node.js?
Molte grazie in anticipo,
sua probablye 'DJBHash' che non riesce – Raynos
ho commentato che la linea ... La riga successiva è fallendo ora ... – Eamorr
try 'Object.prototype.toString.call (responseData)' – Raynos