Find mid point of string
I have a one string..i want to fetch application No after word " (21) Application No".can anybody give me some code for this?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Sep 13, 2009, 11:27 PM EDT
string test = "(21) Application N0";
test = test.Substring(4,test.Length-4);
Roei BarRank #1,271 · 1.4K reputationPosted Sep 13, 2009, 11:49 PM EDT
to find the midPoint you will do the following code:
string test = "(21) Application N0";
int midPoint = test/2;
to find a location to Substring From, work with IndexOf
like the following
string test = "(21) Application N0";
int startIndex = test.IndexOf(')'); //this will give us the location to start the substring from
and then
test = test.Substring(startIndex);// we only need the start location since we want the rest of the sentence