I need to replace <span> entries in a string to legacy html code because it's going to be used in a report for Crystal Reports. <b> works with Crystal, but the<span>'s do not.
Here's the string which I'm trying to replace: <span style="font-weight: bold">%THIS CAN BE ANY TEXT%</span>. I want to replace it to
I am trying to write a simple search form for our site. Here is my delima... I am trying to figure out that if there is nothing to search for in one textbox then search in the next textbox. The problem is that I dont know how to format my search string: For Example:
I have everything working as I wanted except that when I search for the keyword and if the keyword is in an URL, it messes up the link. For instance if I search for music, the keyword in the URL is replaced by
[Code]....
so in the end the URL is like this:
[Code]....
How do I avoid replacing the keyword if the keyword is an URL? Someone mentioned using IndexOf but I'm not sure.
I have a string with special characters insert in different places. For example:
string myString = "This is a textbox: ##";
I would like to replace the ## with a control (namely, a textbox).
The Replace method only allows the string to be replaced with another string or character (understandably). But what would be the best way to dynamically replace the ## with a control in its position?
I was thinking maybe I could replace it with HTML markup which would be executed, but not quite sure how that would be achieved.
EDIT: To clarify some details. The strings are being retrieved from a database, so I can't use the PlaceHolder control. The user selects a string from a drop-down list. The value of the item is the string with special characters. When the postback occurs from the item selection, I would like to display the string on the site, but replace the special characters with a fully working control (in this case, a textbox)
How i can make the normal search string to sql server full text search parse, because when we are user enyer search text "how to run windows schedule in C#", in database we have article to to this, but data not returning and sometime is say error in key word and etc.
so that the resulting output does not contain words at the centre.In the above code instead of giving the word vocation exclusively, i have to mention some pattern, so that it will replace all the words instead of doing it for first sentence only.How to modify my code?
i have convert one of my Repeater to html format using Stringbulider and HtmlTextWriter. now i got html string. my repeater had some image Tags which i don't need it. so i want to replace the image tag(s) with empty sapce. i came to know its possible with using System.Text.RegularExpressions; Regex Thing is dont know how to find the all img tags from the string.
I created 2 functions that do this, but I do not this it efficient at all. I have a 40mb file and it takes the program about 2 hours to complete. Is there a more efficient way to do this? Is there a way to use regex? See my code below:.....................
I have a string that I'm pulling from an Excel spreadsheet that is x.firstName
When I pull it in it gets converted to x#FirstName
Fine. So I tried string.replace as shown below and it change my string.
here's my code:
string stFormattedColumnName = objDataset1.Tables[0].Columns[i].ToString().ToLower(); //value is x#firstName stFormattedColumnName.Replace('#', '.'); //value is still x#firstName
I have string. There are no items to show in this view of the "Personal Documents" then assign to string str variable string str ="There are no items to show in this view of the "Personal Documents" library" Now planning to replace "" and make it to actual string to str object. I tried below, but did not worked
str = str.Replace(@"",string.Empty);
I want str value should be string str ="There are no items to show in this view of the "Personal Documents" library" I need to find this string in another string. While searching into that string. I couldn't found because str contains "".
I want to specify the field names at runtime as mentioned above - sql = "Insert into [Sheet1$] ('" + field1 + "','" + field2 + "') values('1','abc')"; When I try this I am getting error.
How to use pattern replacement in the RTF?. For example you can add a placeholder like {USER_FIRST_NAME} in the RTF document. When the user clicks the download button, your application can take the information from the database and replace every instance of {USER_FIRST_NAME} with the data from the database....