Click here to Skip to main content
15,077,377 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi All,

i am getting the id from the database as like this

url="http://localhost/project/IT/affect/run_report.TXT,
run_report " ows_MetaInfo="1000;#"; ows__ModerationStatus=0"
ows__Level="1" ows_ID="1000" ows_ows



but i want to get the value like this

url="http://localhost/project/IT/affect/run_report.TXT,
run_report " ows_MetaInfo="1000;#"; ows__ModerationStatus=0"
ows__Level="1" ows_ID="1000


i have to take the value of last " ending with this


Plz paste sample code to do this

Regards,
basha.
Posted
Updated 7-Feb-11 20:31pm
v2

1 solution

Use the string.lastindexof[^] method to find the position of the final double quote character, and then use string.substring[^] to remove all trailing characters:
C#
string inp = "url=\"http://localhost/project/IT/affect/run_report.TXT, " +
             "run_report \" ows_MetaInfo=\"1000;#\"; ows__ModerationStatus=0\"" +
             "ows__Level=\"1\" ows_ID=\"1000\" ows_ows";
int finalDQ = inp.LastIndexOf('"');
inp = inp.Substring(0, finalDQ);
   
Comments
   
Aha, a 5.
--SA
JF2015 8-Feb-11 2:57am
   
It's really as simple as this. Good. 5+
inayat basha 8-Feb-11 3:25am
   
thx for ur answer

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

  Print Answers RSS
Top Experts
Last 24hrsThis month



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