IndexOf I understand, but I don't get how I would use in this context. Maybe I wasn't clear in my original post.

I can receive any number of bytes over the socket, sometimes several thousand (in 1024 blocks). In this response, there are many x0A characters, which I would like to replace with x0D0A. However, there are also already x0D0A sequences also, so I don't want those to end up being X0D0D0A.

Right now I'm searching for x0D0A, replacing with x0A, then search for x0A and replacing with x0D0A. This method just doesn't seem effecient.