Possible Duplicate:
How do you perform string replacement on just a subsection of a string?
How to replace a string from position X to Y only, is there a string method?
input = ABCDXYZABCDXYZ
string replace input (start position = 3, end position=9, XYZ to PQR)
XYZ from position 3 to 9 should be replaced
output = ABCDPQRABCDXYZ
Here is an extension method that will create the method you described: