Removing Page numbers from text

Hi,
I have 2 inputs from these 2 inputs i need to remove page numbers ad replace with “|” symbol and write it into the excel, I have highlighted the page numbers, the highlighted one should be removed, In both the input, page numbers are in different format for example in first input it is given like “89” and in second input it is like “75-76” inside the text also numbers,“-” are there that should not be removed only the page numbers that i have highlighted

For example Input-“Schedule of Closed Grants 21B-5026 - WX - Plumas & Sierra Counties 45-46”
Desired output should be “Schedule of Closed Grants 21B-5026 - WX - Plumas & Sierra Counties|” like that i need ,i have tried different solution but it is not working dynamically, For reference i will attach two input files, Please help me to find the solution,
Regards,
Alan
Input 1.docx (12 KB)
Input 2.docx (11.8 KB)

Hi @alan.prakash This is doable…
Have a look at this

PageNmmRemover.zip (3.8 KB)

here my input text is in string format, so how can we convert it into array?

Depends on how your input would come…
If it is coming like how you have shown in the word docs then just use string.split with newline as the separator. For example:

arrInputIntexts = strYourInputString.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)

In my sample I have just used arrInputIntexts just to have a short way of using all your examples.