<script language="javascript">
function strcon() {
var b = '';
var a = "This Is A Sample String";
for (i = 0; i < a.length; i++) {
if (a.charCodeAt(i) >= 65 && a.charCodeAt(i) <= 90) {
b = b + a.charAt(i).toLowerCase();
}
else
b = b + a.charAt(i).toUpperCase();
}
alert(b);
}
</script>