How to trim the end of a string after the first occurence of a char C# : I want to trim the end of a string after the first occurence of a given character, in this case '.'

This character appears multiple times in the string.

Input: 143.122.124.123

Output: 143

I can find multiple questions similar to this alhtough they all use LastIndexOf(); where as this requires the first occurence and remove the rest of the string.