Word replace activity only suports replace all

activities

#1

using the activity replace text for word, and found this activity will replace all the matched text instead of the first found

for example, I want to replace the very first “ABC” in a word document which has many "ABC"s in it, and the activity replaced all the “ABC” in the doc, this is weird

at least, give us an option that to choose “replace all” or “replace”

hoping will solve this in new updates


#2

Yep, it’s typical behavior of “Replace” in .NET
However, you can use SubString and IndexOf to replace of only first word.


#3

afraid it is not a good solution for a doc with 3 million characters and have a lot formatting requirements…


#4

Hi Solution to your Answer is

string yourString = “ABC98ABC9898”;

var s = yourString.Substring(3);

Thanks :wink:


#5

Dear…

it is not a solution to my question~~

but thank you all the same~


#6

Dear,
You can use here regular expression.For replaced your all matched character of a string.


#7

If you have something to identify, then I am sure the solution can work with 5 million characters :wink: