あなたは正規表現を使用することができます。 https://msdn.microsoft.com/en-us/library/az24scfc(v=vs.110).aspx
//This is the pattern for the first case WL followed by a one or more (+) digits (\d)
//followed by any number of characters (.*)
//the parenthesis is to us to be able to group what is inside, for further processing
string pattern1 = @"WL \d+ (.*)";
//Pattern for the second match: CNF followed by a letter (\w) followed by one or two ({1,2})
//digits (\d) followed by one or more (+) digits (\d), followed by (LB) "\(LB\)"
//the backslach is to get the litteral parenthesis
//followed by any number of characters (.*)
//the parenthesis is to us to be able to group what is inside, for further processing
string pattern2 = @"CNF \w\d{1,2} \d+ \(LB\) (.*)";
string result="";
if (Regex.IsMatch(inputString, pattern1))
{
//Groups[0] is the entire match, Groups[1] is the content of the first parenthesis
result = Regex.Match(inputString, pattern1).Groups[1].Value;
}
else if (Regex.IsMatch(inputString, pattern2))
{
//Groups[0] is the entire match, Groups[1] is the content of the first parenthesis
result = Regex.Match(inputString, pattern2).Groups[1].Value;
}
あなたの質問は何ですか?どのプログラミング言語を使用しますか? –
私はC#asp.netを使用しています –
あなたの目的を明確にする必要があります。まともな例を共有することもできます – Progressive