I'm new to programming in c# and I'm trying to figure out how I could
potentially reverse all words except words containing e
in a string.
my current code will detect words containing e
, and just writes them down in another textbox:
string text = txbInput.Text;
var words = text.Split(' ');
for (int i = 0; i < words.Length; i++)
{
if (words[i].Contains('e'))
{
txbOutput.Text += words[i];
}
Current:
Input: chicken crossing the road
Output: chickenthe
.
Expected outcome:
Input: chicken crossing the road
Output chicken gnissorc the daor