Indent each line

    0

    0

    Giovanny Gongora

    Codiga's TypeScript Recipes

    Indents each line in the provided string.

    const indentString = (str: string, count: number, indent = ' ') =>
      str.replace(/^/gm, indent.repeat(count));
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.