PDA

View Full Version : بریدن متن از قسمتی به بعد و به قبل ؟



alnajon
پنج شنبه 25 تیر 1394, 16:32 عصر
با سلام
دوستان چطور میشه یک متن رو داخل نرم افزارمون از قسمتی به قبل و از قسمتی به بعد برید ؟

برای مثال این متن ماست :



An Arizona black history professor has been caught repeatedly plagiarizing material for textbooks, including by copying paragraphs from sites like Wikipedia. Despite this, he has been punished with a relative slap on the wrist, keeping his job and losing only a small part of his generous salary.
Until the last few days, Matthew Whitaker was a full professor at Arizona State University and was the founding director of the school’s Center for the Study of Race and Democracy. But complaints from Whitaker’s fellow academics and an anonymous blog forced the school to investigate one of his textbooks, “Peace Be Still: Modern Black America From World War II to Barack Obama”. The investigation discovered “significant issues” with the book, such as major passages ripped from other books or even websites like Infoplease.

The website Inside Higher Ed compared passages in Whitaker’s book to uncited outside sources when the new accusations first surfaced is 2014. For example, this is a passage from the website Infoplease

حالا من میخواهم این متن از کلمات keeping his job and به بعد و از کلمات uncited outside sources به قبل رو ببرم و از متن بالا این متن باقی بمونه ؟

losing only a small part of his generous salary
Until the last few days, Matthew Whitaker was a full professor at Arizona State University and was the founding director of the school’s Center for the Study of Race and Democracy. But complaints from Whitaker’s fellow academics and an anonymous blog forced the school to investigate one of his textbooks, “Peace Be Still: Modern Black America From World War II to Barack Obama”. The investigation discovered “significant issues” with the book, such as major passages ripped from other books or even websites like Infoplease.

The website Inside Higher Ed compared passages in Whitaker’s book to


ممنون میشم راهنمایی کنید ...

ramtinak
پنج شنبه 25 تیر 1394, 16:48 عصر
سلام خیلی آسونه!

string source = "matnet";string startRemove = "keeping his job and";
string endRemove = "uncited outside sources";


string str = source.Substring(source.IndexOf(startRemove));
str = str.Substring(0,str.IndexOf(endRemove));


حالا اگه میخوای

keeping his job and هم داخلش نباشه کافیه که کد زیر رو:
string str = source.Substring(source.IndexOf(startRemove));
اینطوری بنویسی:
string str = source.Substring(source.IndexOf(startRemove) + startRemove.Length);



اگه میخوای توی متنت
uncited outside sources هم باشه، کافیه کد زیر رو:
str = str.Substring(0,str.IndexOf(endRemove));
این شکلی بنویسی:
str = str.Substring(0,str.IndexOf(endRemove) + endRemove.Length);

اگه کلمه ای رو اشتباه نوشتم ببخشید، چون از حفظ نوشته شده.
موفق باشید