Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Get Error Message Based on String
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { string text = "CSB3410;CR0QAX10003628 LIQAW SOEZ CR2Z*Benefit not valid for accounts with prepaid plans. Manage Customer account.=>CustomerAccountCACTO104.tztCustomer benefits"; Console.WriteLine("Message : "+GetErrorMessage(text)); } public static string GetErrorMessage(string text) { int startIndex = text.IndexOf('*') + 1; int endIndex = text.LastIndexOf('>'); int length = endIndex - startIndex - 1; return text.Substring(startIndex, length); } } }
run
|
edit
|
history
|
help
0
Plt-D v.0.9.3.1
Testing 002
V
Sum of numbers in string
test examen
transform string to hex code
Typeing
C# goes Javascriptish (or Pythonish)
multi variable random number generator
2