| Author: Kundan Kumar Sinha 26 Aug 2008 | Member Level: Gold | Rating: Points: 2 |
Hi Shalini,
In stead of replacing HEAD with ABC, you replace ~HEAD~ with ~ABC~
It will solve your problem.
Regards, Kundan
|
| Author: Sreekanth M 28 Aug 2008 | Member Level: Silver | Rating: Points: 6 |
Hi Shalini, Actually if from what Kundan says you to replace ~HEAD~ with ~ABC~ then the ~HEAD occuring at the end of the string will also not get replaced as you had wished for earlier. The behavior of replace function is correct and I dont think there is a generic solution for this kind of scenario. You could create a custom replace function that would check if there are no letters that precede or supercede the required string to be replaced. This can be done by checking if the ascii value of the characters lies btw 65-90 or btw 97-122 by getting the integere value of the characters coming before or after the string in concern.
|