Today I'm trying to fix some problem but i can't understand why return this Ans to me.
string text = "<Design><Code>"
var Ans = text.Substring(0, text.IndexOf(">"));
I can't understand why Ans will return "<Design" this to me.
I think the "<Design>" <-- this Ans was correct.
text.IndexOf(">")will return 7 here. so<Designis right - second argument toSubstring()is number of characters to copy.var Ans = text.Substring(0, text.IndexOf(">") + 1);