【逐日一包0011】pad

[github地点:https://github.com/ABCDdouyae…]

pad

给字符串的摆布加padding,也能够用于删减字符串两头

用法:pad(str, length, options)|pad(length, str, options)

options:

  • char (string): 指定字符添补
  • colors (boolean):Ajust to hidden terminal color characters, you may also use require ‘pad/lib/colors’ to avoid passing this option.
  • strip (boolean):请求的长度小于原字符串长度,会对原字符串删减,默许false
  • fixed_width (boolean):An optimization option to disable the usage of the wcwdith package to handle the discovery of characters using more than one column for display. one column to display
  • wcwidth_options (object):Options passed to the wcwidth package used to calculate the display width of characters using more than one column.

返回:string

    原文作者:王炜
    原文地址: https://segmentfault.com/a/1190000017021464
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞