Click here to Skip to main content
15,884,537 members
Home / Discussions / C#
   

C#

 
GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz27-Dec-17 7:37
Damian Bz27-Dec-17 7:37 
GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz27-Dec-17 9:15
Damian Bz27-Dec-17 9:15 
GeneralRe: C # + Regex help (for a newbie) Pin
Richard MacCutchan27-Dec-17 21:56
mveRichard MacCutchan27-Dec-17 21:56 
GeneralRe: C # + Regex help (for a newbie) Pin
OriginalGriff28-Dec-17 1:51
mveOriginalGriff28-Dec-17 1:51 
GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz28-Dec-17 6:59
Damian Bz28-Dec-17 6:59 
AnswerRe: C # + Regex help (for a newbie) Pin
Gerry Schmitz28-Dec-17 8:17
mveGerry Schmitz28-Dec-17 8:17 
GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz28-Dec-17 23:21
Damian Bz28-Dec-17 23:21 
GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz29-Dec-17 1:48
Damian Bz29-Dec-17 1:48 
OK fixed it ! probably viewed as clunky, but it works ! Smile | :)

Created this:
C#
private readonly char[] notallowed = { '!', '"', '#', '%', '&', '\'', '(', ')', '*', ',', '-', '/', ':', ';', '?', '@', '[', '\\', ']', '_', '{', '}', '+' };


Then in the functions where I need to allow the use of a "." but no other non numerical characters i've added this:
C#
if ((nicstrength.Text.Any(chr => char.IsLetter(chr))) || (nicstrength.Text.StartsWith(".")) || (nicstrength.Text.IndexOfAny(notallowed) != -1))


I have now tested every single textbox, and none will allow any incorrect entries .. yay.
I think my first C# app is done and ready to meet the world !

Many thanks for the help thus far, I'm sure i'll need plenty more Smile | :)
Cheers
Damian
GeneralRe: C # + Regex help (for a newbie) Pin
Gerry Schmitz29-Dec-17 6:03
mveGerry Schmitz29-Dec-17 6:03 
QuestionSet datagrid cell value individually and dynamically Pin
Hervend26-Dec-17 22:17
Hervend26-Dec-17 22:17 
AnswerRe: Set datagrid cell value individually and dynamically Pin
Richard MacCutchan26-Dec-17 22:37
mveRichard MacCutchan26-Dec-17 22:37 
GeneralRe: Set datagrid cell value individually and dynamically Pin
Hervend26-Dec-17 22:52
Hervend26-Dec-17 22:52 
GeneralRe: Set datagrid cell value individually and dynamically Pin
Pete O'Hanlon26-Dec-17 22:56
mvePete O'Hanlon26-Dec-17 22:56 
GeneralRe: Set datagrid cell value individually and dynamically Pin
Hervend26-Dec-17 23:37
Hervend26-Dec-17 23:37 
GeneralRe: Set datagrid cell value individually and dynamically Pin
Richard MacCutchan26-Dec-17 23:29
mveRichard MacCutchan26-Dec-17 23:29 
GeneralRe: Set datagrid cell value individually and dynamically Pin
Hervend26-Dec-17 23:35
Hervend26-Dec-17 23:35 
QuestionParentheses vs curly brackets Pin
User9874326-Dec-17 12:17
professionalUser9874326-Dec-17 12:17 
AnswerRe: Parentheses vs curly brackets Pin
Gerry Schmitz26-Dec-17 12:36
mveGerry Schmitz26-Dec-17 12:36 
GeneralRe: Parentheses vs curly brackets Pin
User9874326-Dec-17 12:54
professionalUser9874326-Dec-17 12:54 
GeneralRe: Parentheses vs curly brackets Pin
Gerry Schmitz26-Dec-17 12:57
mveGerry Schmitz26-Dec-17 12:57 
GeneralRe: Parentheses vs curly brackets Pin
User9874326-Dec-17 15:00
professionalUser9874326-Dec-17 15:00 
GeneralRe: Parentheses vs curly brackets Pin
BillWoodruff26-Dec-17 15:36
professionalBillWoodruff26-Dec-17 15:36 
GeneralRe: Parentheses vs curly brackets Pin
User9874326-Dec-17 17:59
professionalUser9874326-Dec-17 17:59 
GeneralRe: Parentheses vs curly brackets Pin
BillWoodruff27-Dec-17 19:40
professionalBillWoodruff27-Dec-17 19:40 
GeneralRe: Parentheses vs curly brackets Pin
User987432-Jan-18 23:13
professionalUser987432-Jan-18 23:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.