concatenating hebrew with number change the order

Nov 4 2019 2:28 PM
hi

when i try to concatenating some str to one

the order is change

for example

str1 =number
str2 = hebrew
str3= number

the str3 concatenating to str1 and not to str2 i guess (if i concatenating with "," is should be ok but i

want fixed length

some explain:

i loop via list dictionary to get length and tag <> (from xml)

after i loop via xml (treat xml like txt)

and get the value between TAG compare list exist and txt/xml exist if match i

get the value between tag and concatenating till end of list dictionary

the problem:::::

the concatenating not by order because the hebrew is RTL i guess

any suggestions?

thanks
  1. for (int index = 0; index < dict.Count; index++) {  
  2.  var item = dict.ElementAt(index);  
  3.  var itemKey = item.Key;  
  4.  var itemValue = item.Value;  
  5.  // int x = Int32.Parse(itemKey);  
  6.  StringBuilder builder = new StringBuilder(itemValue);  
  7.  builder.Replace("<", " int lengthh = builder.Length;  
  8.   StringBuilder builderWO = new StringBuilder(itemValue); builderWO.Replace(">""/>"); foreach(string line in lines) {  
  9.    int theFirstLen = line.Trim().IndexOf(itemValue);  
  10.    int theLastLen = line.Trim().IndexOf(builder.ToString());  
  11.    int theLastLenWO_OPEN = line.Trim().IndexOf(builderWO.ToString());  
  12.    if (theFirstLen >= 0 && theLastLen > 0 || theLastLenWO_OPEN >= 0) {  
  13.     if (theLastLenWO_OPEN >= 0) //mean that we need to put spaces only  
  14.     {  
  15.      SR_LEFT = SR_LEFT + "{" + i + ",-" + itemKey.Substring(0, itemKey.IndexOf(".")) + "}";  
  16.      Console.WriteLine(itemKey.Length - itemKey.IndexOf("."));  
  17.      SR_RIGHT = SR_RIGHT + new string(' ', Int32.Parse(itemKey.Substring(0, itemKey.IndexOf("."))));  
  18.      i += 1;  
  19.      break;  
  20.     } else {  
  21.      // Console.WriteLine(line.Trim().Substring(theFirstLen + lengthh, theLastLen - theFirstLen - lengthh));  
  22.      SR_LEFT = SR_LEFT + "{" + i + ",-" + itemKey.Substring(0, itemKey.IndexOf(".")) + "}";  
  23.      SR_RIGHT = SR_RIGHT + line.Trim().Substring(theFirstLen + lengthh, theLastLen - theFirstLen - lengthh);  
  24.      i += 1;  
  25.      break;  
  26.     }  
  27.    }  
  28.   }  
  29.  }  
  30.  using(StreamWriter sw = new StreamWriter("C:\\TST.TEXT"false)) {  
  31.   sw.WriteLine(SR_LEFT, SR_RIGHT);  
  32.  }  
  33. }

Answers (1)