zoukankan      html  css  js  c++  java
  • Methods

    • string.prototype.trim()

      • The trim() method removes whitespace from both ends of a string. Whitespace in this context is all the whitespace characters (space, tab, no-break space, etc.) and all the line terminator characters (LF, CR, etc.).
      • Description

        The trim() method returns the string stripped of whitespace from both ends. trim()does not affect the value of the string itself.

      • var orig = '   foo  ';
        console.log(orig.trim()); // 'foo'
        
        // Another example of .trim() removing whitespace from just one side.
        
        var orig = 'foo    ';
        console.log(orig.trim()); // 'foo'
        
    • String.prototype.toUpperCase()

      •   The toUpperCase() method returns the calling string value converted to uppercase (the value will be converted to a string if it isn't one).
      • Description

        The toUpperCase() method returns the value of the string converted to uppercase. This method does not affect the value of the string itself since JavaScript strings are immutable.

        You cannot call this method on null or undefined (via Function.prototype.call, for example) , if you do, a TypeError will be thrown.

      • console.log('alphabet'.toUpperCase()); // 'ALPHABET'
        
    永远渴望,大智若愚(stay hungry, stay foolish)
  • 相关阅读:
    用ildasm和ilasm对.net下的exe程序进行破解初探
    随笔--各种概念等等
    C#高级编程学习一-----------------第五章泛型
    visual studio相关操作
    webservice开发
    delphi各种错
    android开发文章收藏
    android开发遇到的问题
    android应用开发基础知道
    数据库各种问题
  • 原文地址:https://www.cnblogs.com/h-hkai/p/8671959.html
Copyright © 2011-2022 走看看