I have a String which contains a substrings One of them is \"1 . 2 To Other Mobiles\" and other is \"Total\".Now as per my requirement i have to read the Contents between first
You mean this?
string currentText = "1 . 2 To Other Mobiles fkldsjkfkjslfklsdfjk Total";
string text = "1 . 2 To Other Mobiles";
int startPosition = currentText.IndexOf("1 . 2 To Other Mobiles");
int endPosition = currentText.IndexOf("Total");
string result = currentText.Substring(startPosition + text.Length, endPosition - (startPosition + text.Length));
In the text "1 . 2 To Other Mobiles fkldsjkfkjslfklsdfjk Total";
The output will be:
fkldsjkfkjslfklsdfjk