aiscript icon indicating copy to clipboard operation
aiscript copied to clipboard

文字列系関数の提案

Open salano-ym opened this issue 1 year ago • 0 comments

端の検索

  • [x] str.starts_with(prefix: str, start: num = 0): bool prefixで始まっているか str.ends_with(suffix: str): bool suffixで終わっているか #652

端の削除

  • [ ] str.remove_prefix(prefix: str): str 先頭がprefixなら削除
  • [ ] str.remove_suffix(suffix: str): str 末尾がsuffixなら削除

幅埋め

  • [x] str.pad_start(width: num, c: str = ' '): str 長さがwidthになるようにcを先頭に追加 str.pad_end(width: num, c: str = ' '): str 長さがwidthになるようにcを末尾に追加 #653

インデント

  • [ ] str.indent(prefix: str): str 各行の先頭にprefixを追加。空白行の扱い?
  • [ ] str.dedent(): str 各行の先頭に共通する長さの空白を削除 cf. #637 cf. https://docs.python.org/ja/3/library/textwrap.html#textwrap.dedent

salano-ym avatar Apr 29 '24 17:04 salano-ym