My Problem is that my Users sometimes did mistakes and i want to avoid this by removing the splitted part of the string automatically.
i dont want to combine the splitted string, i just want to remove all what is written after the space.
All what i selected should be automatically removed after i press the Button to Save/Confirm.
>Solution :
Source: Removing everything after the first " " in a string? (space)
It would be simpler to do a string.Split():
string input = "some:kind of string that I want totrim please.";
input = input.Split()[0];
//input = "some:kind" now
So it should look something like this, based on what are you working on (I suppose WPF)
string inputText = txtInput.Text;
inputText.Split()[0];
