1) needing such a conversion often indicates a bad design e.g. a bad choice of data structuring;
2) and when unavoidable, i.e. when I do need to map characters to small positive integers, I use a snippet that is based on "literalString".IndexOf(char)
PS: at least two replies mentioned readability, which does not even appear (any more?) in the OP.
I hate it when the OP gets edited, and yes readability is very important.
Luc Pattyn I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
I doubt that you can (correctly) deduce a regex from sample data. Take the phone-number column as an example, with this data;
What mask would the first three five's generate, and would that mask be reusable as a phone-number-mask?
It gets worse, since the generated mask isn't a phone-number-mask (even if you base it on the data in that column) - it will be a mask that allows all data within that column (since that's what it's based on).
The best approach would be to make a list of examples for each column, containing correct and incorrect values. Next, you base the regex on the domain of the values that you expect. Lastly, a unit-test to verify that the regex works
The mask is not only for a corporate sites, it is for the entire web.
if i specify to mask all the security No (SSN) in a page, even if i Google it also, i have to mask the SSN in the Google page as (XXXXXXXX). I have done that using ihtmlElementCollection (BHO). My problem is i know SSN format so there is no issue.But there can be any format, so just seeing one format dynamically i want to generate the regex. This question may be quiet meaningless, but we can could arrive a solution. if no one had come across like this, then i will try to generate a algorithm to achieve, but my thinking is, if already some one knows on that, then i don't want to wast my time to creating algorithm again.
But there can be any format, so just seeing one format dynamically i want to generate the regex.
Your application encounters the string "8572398947". Is that my SSN (being Dutch), or my SSN + 1, or just a random number? How would you know that the string is in fact, a SSN if you cannot verify that it is?
for example if i give :
firstname.lastname@example.org - we can make regular expression for all the mails,
So taking this example, you take that input and generate an "email address" regex from it. Now I try to enter my email address (which is .co.uk) and whoops, it fails. Yet mine is a totally valid email address.
There is absolutely no way you can make a regular expression from input data and have it work in all cases.
plz help me in....how to design page navigation window form using back and next button......for exmple...if we take a window like install wizard window..in that v use a button name as next.. if we clik that next ..the next page ill be open ...like ....sooo can u any one send me that source code...
Don't ask for source code. Present your problem and how you've tried to solve it and include any error messages / exceptions etc.
To answer your question: if you want to create something like a WinForm wizard, open the "next step" form when clicking the "Next" button and close the old form (or hide it if the user wants to go back). Pass on any paramteters you might be needing.
Hi if it is in web application.
You have properties in the Datagridview itself.Just google it, you will find the answers,
But my concern on paging is based on the performance, i am not interested on bringing 100000 records to the client side just to show 10 records in the gridview. so i am manipulating and doing paging in the database itself( SQL SERVER 2005),i have checked this performance. it is 7 times faster than the ordinary paging comes along the gridview.
Try it.I have done a user control for paging and filtering works fine.