<script language="JavaScript">
// 測試字串
var str1="JavaScript";
var str2= new String("台灣");
document.write("測試的英文字串: \"" + str1 + "\"<br>");
document.write("測試的中文字串: \"" + str2 + "\"<br>");
document.write("英文字串長度: " + str1.length + "<br>");
document.write("中文字串長度: " + str2.length + "<br>");
document.write("全部小寫: " + str1.toLowerCase() + "<br>");
document.write("全部大寫: " + str1.toUpperCase() + "<br>");</script>
沒有留言:
張貼留言