StringReplaceAll

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Description

Replaces the old_value string in str with new_value.

Prototype

APIs taking string arguments will be deprecated in future releases. Use APIs taking non-string arguments instead.

1
2
static std::string StringReplaceAll(std::string str, const std::string &old_value, const std::string &new_value);
static AscendString StringReplaceAll(const char_t *str, const char_t *old_value, const char_t *new_value);

Parameters

Parameter

Input/Output

Description

str

Input

Source string to be processed

old_value

Input

String to be replaced

new_value

Input

String used to replace old_value

Returns

Parameter

Description

-

New string

Restrictions

None