How to remove last string element unnecessary text if exists?

  • Thread starter Thread starter Learning Rocks
  • Start date Start date
L

Learning Rocks

Guest
Hello All,

I have a string array with 3 elements like below for example.

string[] stringarray1;

stringarray1 = new string[5]{ “Element 1\n”, “Element 2\n”, “Element 3\n”, “Element 4\n”, “Element 5\nblablablabla” };
Here i need to check last element in string array having unnecessary dynamic text "\nblablablabla", if exists i need to remove(till last of the dynamic text) and replace with "Element 5\n" in last element.

How to achive it. pls help me

Thanks

Continue reading...
 
Back
Top