microsoft-cognitiveservices-speech-sdk
Version:
Microsoft Cognitive Services Speech SDK for JavaScript
15 lines (14 loc) • 857 B
TypeScript
import { IStringDictionary } from "./IDictionary.js";
/**
* String helper functions
*/
export declare class StringUtils {
/**
* Formats a string by replacing the named {keys} in the string with the values contained in the replacement dictionary.
* @param format The format string that contains the parts to replace surrounded by {}. For example: "wss://{region}.cts.speech.microsoft.com".
* If your string needs to contain a { or } you can use the {{ and }} escape sequences respectively.
* @param replacements The dictionary of replacements. If a replacement is not found, it is replaced with an empty string
* @returns The formatted string. If you pass in a null or undefined format string, an empty string will be returned
*/
static formatString(format: string, replacements: IStringDictionary<string>): string;
}