Click here to Skip to main content
15,117,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am Trying to find a string in file using IndexOF() it work but I want to display a string which come after that InedxOf() and con-cat both string(IndexOf String and After that IndexOf) It can be possible.?

e.g.
My name is ABC I'm Learning ASP.NET.

I found "name" string but I want display the after the "name" string.
which is :name is ABC I'm Learning ASP.NET.
Posted

This is the answer

ASM
string test ="My name is ABC I'm Learning ASP.NET.";
               test = " name" + test.Replace("name", "");
   
Comments
Member 11466475 6-Apr-15 3:50am
   
Thanx for the help but i want only
"name is ABC I'm Learning ASP.NET."
not "My" string..
Code For You 6-Apr-15 3:54am
   
Here you go
string test ="My name is ABC I'm Learning ASP.NET.";
test = test.Replace("My","");
test = " name" + test.Replace("name", "");
I think this is what you want:
C#
string input = "My name is ABC I'm Learning ASP.NET.";
int index = input.IndexOf("name");
string result = input.SubString(index);
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900