Could you explain of what kind of type your content template above is. If it is a simple string, you could replace it with the following regex expression:
static void Main(string[] args) {
string txt = @"LINK1: http://www.google.co.in
LINK2: http://yahoo.com
LINK3: http://www.apple.com/
LINK6: http://www.apple.com/iphone/features/
LINK4: http://www.apple.com/ipod
LINK5: http://www.apple.com/iphone
LINK7: http://rikinpatelcs.webs.com/apps/photos
LINK8: http://rikinpatelcs.webs.com/apps/videos
LINK9: http://www.apple.com/iphone/built-in-apps/
LINK9: http://www.apple.com/iphone/from-the-app-store/
LINK10: http://www.apple.com/iphone/icloud
LINK11: http://www.apple.com/mac";
string[] arr = txt.Split('\n');
string pattern = @"(?<=LINK3:\s).*(?=\r)";
for (int i = 0; i < arr.Length; i++) {
arr[i] = Regex.Replace(arr[i], pattern, @"http://www.xyz.com/");
Console.WriteLine(arr[i]);
}
Console.ReadKey();
}
But I'm not sure, if I understand you correctly. You might give us a little more details.
wizend
No comments:
Post a Comment