Click here to Skip to main content
14,384,304 members
   

C#

 
QuestionHow to delete a file during build/execute in C# Pin
Member 1466381121-Nov-19 6:24
memberMember 1466381121-Nov-19 6:24 
AnswerRe: How to delete a file during build/execute in C# Pin
OriginalGriff21-Nov-19 7:00
protectorOriginalGriff21-Nov-19 7:00 
Question[Solved] Drag and Drop a folder to a textBox within a User Control Pin
W3453121-Nov-19 3:45
memberW3453121-Nov-19 3:45 
AnswerRe: Drag and Drop a folder to a textBox within a User Control Pin
Dave Kreskowiak21-Nov-19 5:52
mveDave Kreskowiak21-Nov-19 5:52 
GeneralRe: Drag and Drop a folder to a textBox within a User Control Pin
W3453121-Nov-19 20:47
memberW3453121-Nov-19 20:47 
GeneralRe: Drag and Drop a folder to a textBox within a User Control Pin
Dave Kreskowiak22-Nov-19 2:58
mveDave Kreskowiak22-Nov-19 2:58 
GeneralRe: Drag and Drop a folder to a textBox within a User Control Pin
W3453122-Nov-19 4:01
memberW3453122-Nov-19 4:01 
QuestionExtract variables from string math expression with parenthesis Pin
foreigh20-Nov-19 23:14
memberforeigh20-Nov-19 23:14 
I want to evaluate an a string math expression , so before i want to extract variables so i have to remove all special characters my code only can remove a special character like `a+b*c` and the result i get is `a=;b=;c=`, now if i write two successive special characters like `(a+b)*c` and `a++b` results will be `=;a=;b=;c=` and `a=;=;b=` always there is a sign `=;` added for no reasons how get rid of them because after that i will use mathematic functions so that will be a real problem for me please help me ! here is my code

public string RemoveSpecialCharacters(string str)
       {
           StringBuilder sb = new StringBuilder();
           for(int i=0; i<str.Length;i++)
           {
               if((str[i] >= '0' && str[i] <='9')
                   ||( str[i] >='A' &&  str[i]<='z'|| (str[i]=='-' || str[i] == '+' || str[i] == '*' || str[i] == '/' || str[i] == '%'|| str[i] ==')' || str[i] == '(')))
               {
                   sb.Append(str[i]);
               }
           }
           return sb.ToString();
       }
       private void button8_Click(object sender, EventArgs e)
       {
           string refine_string = RemoveSpecialCharacters(textBox1.Text);
           string[] split_var = refine_string.Split('+', '-', '/', '%', '^', '*', '=',')','(');
           double value;
           string str = "";
           for (int i = 0; i < split_var.Length; i++)
           {
               if (double.TryParse(split_var[i], out value))
               {
                   split_var[i] = " ";
               }
           }
           split_var = split_var.Where(s => s != " ").ToArray();
           string[] variables = split_var.Distinct().ToArray();

           for (int j = 0; j < variables.Length; j++)
           {

               str = str + variables[j] + '=' + ";";

           }
           textBox2.Text = str.TrimEnd(';');

       }

AnswerRe: Extract variables from string math expression with parenthesis Pin
OriginalGriff20-Nov-19 23:56
protectorOriginalGriff20-Nov-19 23:56 
GeneralRe: Extract variables from string math expression with parenthesis Pin
foreigh21-Nov-19 0:32
memberforeigh21-Nov-19 0:32 
GeneralRe: Extract variables from string math expression with parenthesis Pin
OriginalGriff21-Nov-19 0:50
protectorOriginalGriff21-Nov-19 0:50 
QuestionHow to use recursion to build dynamic menu from database in c# Pin
Mahmoud EL-Shazly20-Nov-19 21:07
memberMahmoud EL-Shazly20-Nov-19 21:07 
AnswerRe: How to use recursion to build dynamic menu from database in c# Pin
OriginalGriff20-Nov-19 22:46
protectorOriginalGriff20-Nov-19 22:46 
GeneralRe: How to use recursion to build dynamic menu from database in c# Pin
Mahmoud EL-Shazly20-Nov-19 22:49
memberMahmoud EL-Shazly20-Nov-19 22:49 
GeneralRe: How to use recursion to build dynamic menu from database in c# Pin
OriginalGriff20-Nov-19 22:54
protectorOriginalGriff20-Nov-19 22:54 
GeneralRe: How to use recursion to build dynamic menu from database in c# Pin
Mahmoud EL-Shazly20-Nov-19 22:57
memberMahmoud EL-Shazly20-Nov-19 22:57 
AnswerRe: How to use recursion to build dynamic menu from database in c# Pin
Mycroft Holmes21-Nov-19 13:56
memberMycroft Holmes21-Nov-19 13:56 
GeneralRe: How to use recursion to build dynamic menu from database in c# Pin
Mahmoud EL-Shazly21-Nov-19 14:19
memberMahmoud EL-Shazly21-Nov-19 14:19 
Question.NET Standard 2.1, Xamarin Android/iOS & Emit Pin
Super Lloyd19-Nov-19 14:00
memberSuper Lloyd19-Nov-19 14:00 
AnswerRe: .NET Standard 2.1, Xamarin Android/iOS & Emit Pin
Super Lloyd20-Nov-19 1:45
memberSuper Lloyd20-Nov-19 1:45 
QuestionNew Object Pool Library Pin
Justin-A-Miller19-Nov-19 9:59
memberJustin-A-Miller19-Nov-19 9:59 
AnswerRe: New Object Pool Library Pin
OriginalGriff19-Nov-19 10:12
protectorOriginalGriff19-Nov-19 10:12 
GeneralRe: New Object Pool Library Pin
Justin-A-Miller19-Nov-19 10:22
memberJustin-A-Miller19-Nov-19 10:22 
GeneralRe: New Object Pool Library Pin
OriginalGriff19-Nov-19 10:51
protectorOriginalGriff19-Nov-19 10:51 
GeneralRe: New Object Pool Library Pin
Justin-A-Miller20-Nov-19 4:48
memberJustin-A-Miller20-Nov-19 4:48 

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.