An easy and simple (but not very good) way is to simply get an array of keys and repeat it updating each row.
string[] mapKeys = myDictionary.Keys.ToArray(); for (int i = 0; i < mapKeys.Length; i++) mapKeys [i] = mapKeys [i].Replace("substringToRemove", "");
But is there a way to do this in 1 line of code (e.g. using LINQ)?
mapKeys = mapKeys.Select(o=>o.Replace("substringToRemove", string.Empty)).ToArray();
or from your myDictionary:
string[] mapKeys = myDictionary.Keys.Select(o=>o.Replace("substringToRemove", string.Empty)).ToArray();
You can use below LINQ:
mapKeys = mapKeys.Select( s => s.Replace("substringToRemove",string.Empty)).ToArray();
Source: https://habr.com/ru/post/1648765/More articles:Implement JWT Authentication in Android with Account Manager - androidЯвляется ли ссылка на частный IR более недоступной в APEX 5? - oracle-apexWhy does “battery life” make Gradle Build Running faster in Android Studio? - androidPython Pandas, create an empty DataFrame with a dtypes column - pythonВозврат Наблюдается в canDeactivate не работает - angularScala reader fashion: return, local, and sequence - scalaHow to run a test jersey container (Grizzly) once for all tests in a test class? - javaScala: question marks in type parameters - scalaHow to change authentication type in SOAP UI 5.2.1? - soap(Xamarin.Forms) System.ArgumentException: Failed to bind to the GetOnServiceConnectedHandler method. - xamarinAll Articles