Aspose::Cells::Workbook::Replace method

Workbook::Replace(const U16String&, const U16String&) method

Replaces a cell’s value with a new string.

int32_t Aspose::Cells::Workbook::Replace(const U16String &placeHolder, const U16String &newValue)
ParameterTypeDescription
placeHolderconst U16String&Cell placeholder
newValueconst U16String&String value to replace

Examples

Aspose::Cells::Startup();
Workbook workbook;
//......
U16String val_1 = u"AnOldValue";
U16String val_2 = u"NewValue";
workbook.Replace(val_1, val_2);
Aspose::Cells::Cleanup();

See Also

Workbook::Replace(const char16_t*, const char16_t*) method

Replaces a cell’s value with a new string.

int32_t Aspose::Cells::Workbook::Replace(const char16_t *placeHolder, const char16_t *newValue)
ParameterTypeDescription
placeHolderconst char16_t*Cell placeholder
newValueconst char16_t*String value to replace

Examples

Aspose::Cells::Startup();
Workbook workbook;
//......
workbook.Replace(u"AnOldValue", u"NewValue");
Aspose::Cells::Cleanup();

See Also

Workbook::Replace(const U16String&, int32_t) method

Replaces a cell’s value with a new integer.

int32_t Aspose::Cells::Workbook::Replace(const U16String &placeHolder, int32_t newValue)
ParameterTypeDescription
placeHolderconst U16String&Cell placeholder
newValueint32_tInteger value to replace

Examples

Aspose::Cells::Startup();
Workbook workbook;
//......
int newVal = 100;
U16String val = u"AnOldValue";
workbook.Replace(val, newVal);
Aspose::Cells::Cleanup();

See Also

Workbook::Replace(const char16_t*, int32_t) method

Replaces a cell’s value with a new integer.

int32_t Aspose::Cells::Workbook::Replace(const char16_t *placeHolder, int32_t newValue)
ParameterTypeDescription
placeHolderconst char16_t*Cell placeholder
newValueint32_tInteger value to replace

Examples

Aspose::Cells::Startup();
Workbook workbook;
//......
int newVal = 100;
workbook.Replace(u"AnOldValue", newVal);
Aspose::Cells::Cleanup();

See Also

Workbook::Replace(const U16String&, double) method

Replaces a cell’s value with a new double.

int32_t Aspose::Cells::Workbook::Replace(const U16String &placeHolder, double newValue)
ParameterTypeDescription
placeHolderconst U16String&Cell placeholder
newValuedoubleDouble value to replace

Examples

Aspose::Cells::Startup();
Workbook workbook;
//......
U16String val = u"AnOldValue";
double newVal = 100.0;
workbook.Replace(val, newVal);
Aspose::Cells::Cleanup();

See Also

Workbook::Replace(const char16_t*, double) method

Replaces a cell’s value with a new double.

int32_t Aspose::Cells::Workbook::Replace(const char16_t *placeHolder, double newValue)
ParameterTypeDescription
placeHolderconst char16_t*Cell placeholder
newValuedoubleDouble value to replace

Examples

Aspose::Cells::Startup();
Workbook workbook;
//......
double newVal = 100.0;
workbook.Replace(u"AnOldValue", newVal);
Aspose::Cells::Cleanup();

See Also

Workbook::Replace(const U16String&, const Vector <U16String>&, bool) method

Replaces a cell’s value with a new string array.

int32_t Aspose::Cells::Workbook::Replace(const U16String &placeHolder, const Vector<U16String> &newValues, bool isVertical)
ParameterTypeDescription
placeHolderconst U16String&Cell placeholder
newValuesconst Vector <U16String>&String array to replace
isVerticalboolTrue - Vertical, False - Horizontal

Examples

Aspose::Cells::Startup();
Workbook workbook;
//......
U16String val = u"AnOldValue";
Vector<U16String> newVals{ u"Tom", u"Alice", u"Jerry" };
workbook.Replace(val, newVals, true);
Aspose::Cells::Cleanup();

See Also

Workbook::Replace(const char16_t*, const Vector <U16String>&, bool) method

Replaces a cell’s value with a new string array.

int32_t Aspose::Cells::Workbook::Replace(const char16_t *placeHolder, const Vector<U16String> &newValues, bool isVertical)
ParameterTypeDescription
placeHolderconst char16_t*Cell placeholder
newValuesconst Vector <U16String>&String array to replace
isVerticalboolTrue - Vertical, False - Horizontal

Examples

Aspose::Cells::Startup();
Workbook workbook;
//......
Vector<U16String> newVals{ u"Tom", u"Alice", u"Jerry" };
workbook.Replace(u"AnOldValue", newVals, true);
Aspose::Cells::Cleanup();

See Also

Workbook::Replace(const U16String&, const Vector <int32_t>&, bool) method

Replaces cells’ values with an integer array.

int32_t Aspose::Cells::Workbook::Replace(const U16String &placeHolder, const Vector<int32_t> &newValues, bool isVertical)
ParameterTypeDescription
placeHolderconst U16String&Cell placeholder
newValuesconst Vector <int32_t>&Integer array to replace
isVerticalboolTrue - Vertical, False - Horizontal

Examples

Aspose::Cells::Startup();
Workbook workbook;
//......
U16String val = u"AnOldValue";
Vector<int> newVals{ 1, 2, 3 };
workbook.Replace(val, newVals, true);
Aspose::Cells::Cleanup();

See Also

Workbook::Replace(const char16_t*, const Vector <int32_t>&, bool) method

Replaces cells’ values with an integer array.

int32_t Aspose::Cells::Workbook::Replace(const char16_t *placeHolder, const Vector<int32_t> &newValues, bool isVertical)
ParameterTypeDescription
placeHolderconst char16_t*Cell placeholder
newValuesconst Vector <int32_t>&Integer array to replace
isVerticalboolTrue - Vertical, False - Horizontal

Examples

Aspose::Cells::Startup();
Workbook workbook;
//......
Vector<int> newVals{ 1, 2, 3 };
workbook.Replace(u"AnOldValue", newVals, true);
Aspose::Cells::Cleanup();

See Also

Workbook::Replace(const U16String&, const Vector <double>&, bool) method

Replaces cells’ values with a double array.

int32_t Aspose::Cells::Workbook::Replace(const U16String &placeHolder, const Vector<double> &newValues, bool isVertical)
ParameterTypeDescription
placeHolderconst U16String&Cell placeholder
newValuesconst Vector <double>&Double array to replace
isVerticalboolTrue - Vertical, False - Horizontal

Examples

Aspose::Cells::Startup();
Workbook workbook;
//......
U16String val = u"AnOldValue";
Vector<double> newVals{ 1.23, 2.56, 3.14159 };
workbook.Replace(val, newVals, true);
Aspose::Cells::Cleanup();

See Also

Workbook::Replace(const char16_t*, const Vector <double>&, bool) method

Replaces cells’ values with a double array.

int32_t Aspose::Cells::Workbook::Replace(const char16_t *placeHolder, const Vector<double> &newValues, bool isVertical)
ParameterTypeDescription
placeHolderconst char16_t*Cell placeholder
newValuesconst Vector <double>&Double array to replace
isVerticalboolTrue - Vertical, False - Horizontal

Examples

Aspose::Cells::Startup();
Workbook workbook;
//......
Vector<double> newVals{ 1.23, 2.56, 3.14159 };
workbook.Replace(u"AnOldValue", newVals, true);
Aspose::Cells::Cleanup();

See Also

Workbook::Replace(const U16String&, const U16String&, const ReplaceOptions&) method

Replaces a cell’s value with a new string.

int32_t Aspose::Cells::Workbook::Replace(const U16String &placeHolder, const U16String &newValue, const ReplaceOptions &options)
ParameterTypeDescription
placeHolderconst U16String&Cell placeholder
newValueconst U16String&String value to replace
optionsconst ReplaceOptions&The replace options

See Also

Workbook::Replace(const char16_t*, const char16_t*, const ReplaceOptions&) method

Replaces a cell’s value with a new string.

int32_t Aspose::Cells::Workbook::Replace(const char16_t *placeHolder, const char16_t *newValue, const ReplaceOptions &options)
ParameterTypeDescription
placeHolderconst char16_t*Cell placeholder
newValueconst char16_t*String value to replace
optionsconst ReplaceOptions&The replace options

See Also