Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
sommilito-bank2
/
splide-4.1.3
/
src
/
js
/
utils
/
string
/
format
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
import { forEach } from '../../array'; /** * Formats a string. * * @param string - A string to format. * @param replacements - A replacement or replacements. * * @return A formatted string. */ export function format( string: string, replacements: string | number | Array<string | number> ): string { forEach( replacements, replacement => { string = string.replace( '%s', `${ replacement }` ); } ); return string; }