首页 > 编程语言 > 详细

JavaScript String常用方法和属性

时间:2019-04-12 23:25:05      阅读:140      评论:0      收藏:0      [点我收藏+]

 一、string中的常用属性

 

 1. length

说明:

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

 

 

 二、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.

 

JavaScript String常用方法和属性

原文:https://www.cnblogs.com/huwt/p/10611977.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!