Frage

I have strings:

string1 = Janko||A12 string2 = VHS No||RY3 string3 = No St bond||40p

I want to always get the last 3 digits after the character ||. How do I go about this?

War es hilfreich?

Lösung

You can do this:

string s1 = "string||23";
var value = s1.Substring(s1.IndexOf("||")+2);

Demo

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top