0.0.3 • Published 8 months ago

@xutil/string v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

String 字符串

x-string字符串

📦 安装

  • 使用 npm 安装

    npm install @xutil/string -S
  • HTML直接引入

    <!DOCTYPE html>
       <html lang="en">
       <body>
          <script src="/dist/index-umd.js"></script>
          <script>
             console.log(XString.byteLength('AA'))
          </script>
       </body>
    </html>

🎨 使用

  • ESM导入使用

    // 全部引入
    import { byteLength } from "@xutil/string"
     console.log(byteLength('AA'))
    
    // 按需引入
    import XString from "@xutil/string"
     console.log(XString.byteLength('AA'))
  • RequireJS导入使用

    // 全部引入
    const XString = require('@xutil/string')
    console.log(XString.byteLength('AA'))
    
    // 按需引入
    const { byteLength } = require('@xutil/string')
    console.log(byteLength('AA'))

方法

   turnCase                        转换大小写
   byteLength                      字节长度
   reverseString                   反转字符串
   sortCharactersInString          按字母顺序对字符串中的字符进行排序
0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago