一、string中的常用属性

 

 1. length

说明:

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

  字符串的长度属性,一直保持跟踪着该字符串中包含的字符数。

 

 

 二、string中的常用方法

 

 1. toLowerCase() 和 toUpperCase()

说明:

  toLowerCase(): returns a copy of the string with its letters converted to lowercase. Numbers, symbols, and other characters are not affected.

  toUpperCase(): returns a copy of the string with its letters converted to capitals. Numbers, symbols, and other characters are not affected.

 

 2. trim()

说明:

  returns a copy of the string with beginning and ending whitespace characters removed.

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄