-
May 6th, 2009, 10:40 AM
#1
Identifying substrings in text
I have a large string in which I need to replace specific strings with other values. For example, within this string I might see the following characters: [[sub id=5]]
I am trying to replace those substrings with values, pulled from a table and based on the id. What would be the simplest way to accomplish this. My first thought was to loop through and examine each character and note their positions when they match the pattern. I would then have to identify the id. That would be fairly complicated, however, and there must be a better way. Any thoughts?
-
May 6th, 2009, 03:16 PM
#2
Re: Identifying substrings in text
Take a look at the replace function
-
May 7th, 2009, 04:43 PM
#3
Re: Identifying substrings in text
like DataMiser said use string.Replace()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|