我要javascript的版本,以上的是vbscript的

解决方案 »

  1.   

    soory
    bbb=left(request("xxx"),len(request("xxx"))-3)
      

  2.   

    str="aaaa"youwantstr=str.substring(1,length(str)-3)
      

  3.   

    <script>
    str="a123"youwantstr1=str.substring(str.length-3)
    youwantstr2=str.substr(str.length-3)
    youwantstr3=str.slice(-3)alert(youwantstr1)
    alert(youwantstr2)
    alert(youwantstr3)
    </script>
      

  4.   

    <script>
    str="a123"youwantstr1=str.substring(0,str.length-3)
    youwantstr2=str.substr(0,str.length-3)
    youwantstr3=str.slice(0,-3)alert(youwantstr1)
    alert(youwantstr2)
    alert(youwantstr3)
    </script>
      

  5.   

    <script>
    str="a123"
    alert(str.replace(/[\w\W]{3}$/,""))
    </script>
      

  6.   

    <script>
    str="a123"
    alert(str.replace(/.{3}$/,""))
    </script>