Link to home
Start Free TrialLog in
Avatar of mathieu_cupryk
mathieu_cuprykFlag for Canada

asked on

Extract an string the following:

I have four strings.
I need to extract
 PanelReOpenedTicket.Visible = false;
                            PanelClosedTicket.Visible = false;
                            PanelWaitingTicket.Visible = false;
                            PanelOpenTicket.Visible = true;

the middle string.
ReOpen
Closed
Waiting
Open
ASKER CERTIFIED SOLUTION
Avatar of philipjonathan
philipjonathan
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mathieu_cupryk

ASKER

thanks.
Hello,
If you are trying to see if those values exist within a string and it will decide which panel will be displayed, the following will work.


if (inputstring.ToLower().Contains("reopen"))
{
    PanelReOpenedTicket.Visible = true;
}
else if (inputstring.ToLower().Contains("closed"))
{
    PanelClosedTicket.Visible = true;
}
else if (inputstring.ToLower().Contains("waiting"))
{
    PanelWaitingTicket.Visible = true;
}
else if (inputstring.ToLower().Contains("opened"))
{
PanelOpenTicket.Visible = true;
}

Open in new window