|
hi,
You can follow a simple logic in this case. When you encounter a "<" symbol note the index of this first ocurrence. Then until you get the proper ">" symbol, parse the string, when you get the symbol, just remove string from the index you noted first and the new index for ">". This logic may be inefficient but its the simplest one. To tweak your performance use StringBuilder instead of string. And one reason for this logic to work is that HTML also parses the text in this manner to render the output, so if the html file is displayed fine in a browser then the above logic will work in any case.
Tell me if it works. I would like to know that.
Anant Y. Kulkarni
|
|
|
|
|
Hi Sir, i will surely try this logic.....but tell me that wots the difference between string class and stringbuilder class and how it effects the efficiency of the program.....
Looking forward for help
Regards,
|
|
|
|
|
Hi,
string is immutable. That means for each operation that you perform on a string a new string object needs to be created and the result of the operations are stored in this new object. Immutable means unchangable. And thats why it is recomended to use StringBuilder class in .Net if frequent string operations are needed to be performed.
To know more about it try searching msdn.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
Rizwan, see this[^] article, specifically the removeHtml() method.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
hi
i have 2 tables (Aparteman,ApartmanDetails) that i want to relate these together.when i create a function as follow :
private void CreateRelation()
{
//ds_Apartman1.Clear();
oleDbDataAdapter1.Fill(ds_Apartman1, "Aparteman");
oleDbDataAdapter2.Fill(ds_Apartman1, "ApartmanDetail");
DataRelation datarelation1;
DataColumn datacolumn1;
DataColumn datacolumn2;
datacolumn1 = ds_Apartman1.Tables["Aparteman"].Columns["id"];
datacolumn2 = ds_Apartman1.Tables["ApartmanDetail"].Columns["id_apartman"];
datarelation1 = new DataRelation("detail", datacolumn1, datacolumn2);
ds_Apartman1.Relations.Add(datarelation1);
//dataGridView1.DataSource = ds_Apartman1.DefaultViewManager;
//dataGridView1.DataMember = "Aparteman";
}
and run it from a button , only table of Aparteman show and don't show ApartmanDetail table.
Please help that how to solve my problem ??
|
|
|
|
|
hi all,i need a messagebox with yes or no buttons without using either script languages or popupwindow and i should able to catch the user input(ie.yes or no)
ayyp
|
|
|
|
|
Use the JavaScript-s prompt() function.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
i need this msgbox without using any script languages and popupwindows is it possible?
ayyp
|
|
|
|
|
No, I don't think it's possible simply because ASP.NET cannot run code on your machine. It is possible however to create a custom control that will have some javascript code in to launch a messagebox-like box. There are some nice articles about such controls on this website, check them out and see if they fit your need.
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
There is no way to make ASP.NET run .NET code on your PC. It has to pass by javascript, since it has to be done from the client-side.
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Ayyp,
This is an article about popup windows in ASP.NET: http://www.codeproject.com/aspnet/asppopup.asp[^]
check it out and let me know.
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
I don't know if you can put buttons inside the control. I haven't tested it. Could you please send your replies to the forum instead of mailing them to me?
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
|
I dont think you find a solution for that. Why do you not interested in Script. You can also try www.visualwebgui.com/ they provide most windows controls to use in your asp.net Application. COOL! ha
-Syed Moshiur Murshed
|
|
|
|
|
hi syed i saw u r msg but i can't get into that site(to see the winform example) is it need to register to enter that site.
ayyp
|
|
|
|
|
and one more thing i need to run this popup or confirm or msgbox only after satisfying two condition (these all are in the same button click event.)when i use script it will run automatically when i click that button,but i dont want that, that box should be displayed only after satisfying condition and i should able to catch the user input that is yes or no like.if u have any code for my need pls send to me.....
ayyp
|
|
|
|
|
Hi all, I want to know that are there any functions like IsDigit and IsSymbol in C# wich let us know that any particular string contains any numbers or puncuation symbols....if they exist then wich r they.....and if they dont then how can we achieve this
Looking forward for help
Regards,
-- modified at 4:37 Saturday 20th May, 2006
|
|
|
|
|
Char.IsDigit, etc, work on a per char basis. I believe there are string based functions, but I have not found them as static methods on string.
You can of course use int.TryParse and double.TryParse to see if the value is an int or a double, respectively.
Christian Graus - Microsoft MVP - C++
-- modified at 4:47 Saturday 20th May, 2006
|
|
|
|
|
Hi,
I dont know about whether there is any in built function for your problem but you can implement this logic in your program by parsing the string character by character and knowing the ASCII codes for them. then compare the ascii codes for each character to be in range of for example numbers, characters or symbols. For this you will have to know the code ranges for numbers, symbols and alphabets in ASCII.
And for inbuilt functions try searching the msdn or msdn online at - http://mdsn.microsoft.com/library
A simple logic would be to convert the string into char[] and then loop in this array to check for Char.IsDigit and Char.IsNumber and Char.IsSymbol, etc....
(I found this after posting the message, so i modified the last post)
Anant Y. Kulkarni
-- modified at 4:45 Saturday 20th May, 2006
|
|
|
|
|
You should NEVER do this. You can use foreach on a string and use Char.IsDigit ( for example ). Using ASCII codes and assuming they are valid is a bad idea on a number of levels.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I havent got your point. Is there any way that the ASCII codes may be wrong? I think as you press the keys the ASCII codes are stored or sent to the program or what ever. but main point is ASCII is used for representing the characters. Means we used to do this in C. Is there any issues related to using ASCII values for comparisions. If yes, i would be greatfull to know. Also can you please elaborate on the point you replied to my post.
Christian Graus wrote: Using ASCII codes and assuming they are valid is a bad idea on a number of levels.
Number of levels? I hope you got my point.
Thanks
Anant Y. Kulkarni
|
|
|
|
|
Anant Kulkarni wrote: Is there any way that the ASCII codes may be wrong?
Well, for starters, they could be unicode codes. .NET is unicode by default.
Anant Kulkarni wrote: Means we used to do this in C.
Yep, I did it in C from time to time, although mostly I'd use the functions built in there, too.
Anant Kulkarni wrote: Number of levels?
As well as the Unicode issue, it's just a hack when the language provides stuff like Char.IsDigit.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sir i have tried to do this in this way
foreach(char ch in docName.ToCharArray())
{
if(ch.IsDigit())
break;
}
but the problem is that this IsDigit and other r static methods so how can i access them
looking forward for help
Regards,
|
|
|
|
|
As it's a static method, you call it as I demonstrated, using the class name
if (Char.IsDigit(ch))
break;
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thxx Sir, its working
|
|
|
|