PDA

View Full Version : جستجوی رشته



kiuhnmgtrdcv
پنج شنبه 24 اردیبهشت 1388, 23:55 عصر
سلام دوستان من یه رشته طولانی دارم که میخوام در ان رشته یه جستجو انجام بدم و رشته ای که فرمت خاصی داره بیرون بکشیم



/* 468x15, created 4/4/09 */
google_ad_slot = "3540740729";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Link download : <b><a href="files/files66a17c401e8b06f442cc410e8daf9a9d/Gxc.AFCS4V_UDS.part03.rar">Gxc.AFCS4V_UDS.part03.rar</a></b>


رشته مورد جستجو چیزیه که با ابتدای
files/
شروع میشه و در </a>
ختم میشه لطفا راهنماییم کنید چطور این رشته پیدا کنم من از کدای پایین برای اینکار استفاده میکنم ولی هنوز کدم کامل نیست



int firstIndex = s.IndexOf("files/");
int LastIndex= s.IndexOf ( ???)

string findText = s.Substring( firstIndex , LastIndex );

Milad Mohseny
جمعه 25 اردیبهشت 1388, 00:51 صبح
int firstIndex = s.IndexOf("files/");
int LastIndex = s.IndexOf("</a>");
string findText = s.Substring(firstIndex, LastIndex - firstIndex);