SOURCE

console 命令行工具 X clear

                    
>
console
function testStr(){
  //var str = "China No.1";
  var str = "你好,我是周杰伦!你好啊哈哈哈哈啊哈哈哈";
  alert(str.substring(0,11));
}
<button onclick="testStr()">字符串测试</button>