How to to replace colon with tab key

@alexey.noskov hi sir I have attached source file as well output file PFA, in table title I need to replace colon with tab key ,if there is no colon also I need to place tab key after table number please help me for this case.

1.docx (18.4 KB)
1_output.docx (18.9 KB)

@srinu12 Table number in the caption is represented with SEQ field. So you can replace colons in the paragraphs with SEQ fields. You can use code like the following to achieve what you need:

Document doc = new Document(@"C:\Temp\in.docx");

// Replace colon in the paragraphs with SEQ field.
foreach (Field f in doc.Range.Fields)
{
    if (f.Type == FieldType.FieldSequence)
    {
        FieldSeq seq = (FieldSeq)f;
        if (seq.SequenceIdentifier == "Table")
        {
            // Replace colon with tab
            int replaces = seq.Start.ParentParagraph.Range.Replace(":", "\t");
            // If no colonn was replaced insert tab right after SEQ field.
            if (replaces == 0)
                seq.End.ParentNode.InsertAfter(new Run(doc, "\t"), seq.End);
        }
    }
}

doc.Save(@"C:\Temp\out.docx");