diff --git a/packages/cactus-common/src/main/typescript/public-api.ts b/packages/cactus-common/src/main/typescript/public-api.ts index 20a2a56ffe..33356a798f 100755 --- a/packages/cactus-common/src/main/typescript/public-api.ts +++ b/packages/cactus-common/src/main/typescript/public-api.ts @@ -2,3 +2,4 @@ export { LoggerProvider } from "./logging/logger-provider"; export { Logger, ILoggerOptions } from "./logging/logger"; export { LogLevelDesc } from "loglevel"; export { Objects } from "./objects"; +export { Strings } from "./strings"; diff --git a/packages/cactus-common/src/main/typescript/strings.ts b/packages/cactus-common/src/main/typescript/strings.ts new file mode 100644 index 0000000000..54cd57b5a3 --- /dev/null +++ b/packages/cactus-common/src/main/typescript/strings.ts @@ -0,0 +1,9 @@ +export class Strings { + public static replaceAll( + source: string, + searchValue: string, + replaceValue: string + ): string { + return source.replace(new RegExp(searchValue, "gm"), replaceValue); + } +}