Вы можете использовать регулярные выражения для этого. И вы даже можете извлечь целочисленные значения с помощью Regex:
var input = "Приветственный_32%50";
var searchPattern = @"(\d+)[%-](\d+)";
var matches = Regex.Matches(input, searchPattern);
if (matches.Count == 1) {
// A single occurence of this pattern has been found in the input string.
// We can extract the numbers from the Groups of this Match.
// Group 0 is the entire match, groups 1 and 2 are the groups we captured with the parentheses
var firstNumber = matches[0].Groups[1].Value;
var secondNumber = matches[0].Groups[2].Value;
}
Объяснение шаблона Regex:
(\d+) ==> matches one or more digits and captures it in a group with the parentheses.
[%-] ==> matches a single % or - character
(\d+) ==> matches one or more digits and captures it in a group with the parentheses.