Options
All
  • Public
  • Public/Protected
  • All
Menu

字符串相关

Hierarchy

  • Strings

Index

Constructors

constructor

Methods

Static endWith

  • endWith(source: string, suffix: string): boolean
  • 判断字符串是否以某个字符结尾

    Parameters

    • source: string

      字符串

    • suffix: string

      字符

    Returns boolean

Static firstUpperCase

  • firstUpperCase(source: string): string
  • 首字母大写

    Parameters

    • source: string

      字符串

    Returns string

Static isEmpty

  • isEmpty(source: any): boolean
  • 判断是否为空,包含undefined

    Parameters

    • source: any

      目标值

    Returns boolean

Static isNotEmpty

  • isNotEmpty(source: any): boolean
  • 判断是否不为空

    Parameters

    • source: any

      目标值

    Returns boolean

Static isString

  • isString(source: any): boolean
  • 判断目标值是否为字符串

    Parameters

    • source: any

    Returns boolean

Static prefixInteger

  • prefixInteger(source: any, length: number): string
  • 数字补0

    Parameters

    • source: any
    • length: number

    Returns string

Static replaceAll

  • replaceAll(source: string, oldStr: string, newStr: string): string
  • 替换字符

    Parameters

    • source: string

      字符串

    • oldStr: string

      老的字符

    • newStr: string

      新的字符

    Returns string

Static startWith

  • startWith(source: string, prefix: string): boolean
  • 判断字符串是否以某个字符开头

    Parameters

    • source: string

      字符串

    • prefix: string

      字符

    Returns boolean