Forum : unique letters in sring .. this code working in all brtowser but no in IE why ? what is solution for this
Brief description  about Online courses   join in Online courses
View vinaykumar B patil 's Profile

unique letters in sring .. this code working in all brtowser but no in IE why ? what is solution for this

<html><head><script>
function code(n, digits, padChar) {
n = n.toString();
while (n.length < digits) {
n = padChar n;
}
return n;
}
var str = window.prompt("Enter String");
var array = [];
var totalCount;
var count=0;

for(var i = 0; i < str.length; i ){
if(!array[str[i]]) {
array[str[i]] = 1;
} else {
array[str[i]] = 1;
}
}
sortedArray = [];
for(var i in array){
sortedArray.push(code(i.charCodeAt(0), 5, '0'));
}
sortedArray.sort();
for(i = 0; i < sortedArray.length; i ){
count ;
}
document.write("Number of unique letters are: " count);
</script></head></html>
Asked by vinaykumar B patil | Dec 21, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Vinay,

Posted code is not working in any of the major browsers.. please mail me the code and i ll reply u back. email: vishwanath@siliconindia.com
Dec 22, 2010