// Token: 0x0600014B RID: 331 RVA: 0x000158D4 File Offset: 0x00013AD4 private string GetKeyString(string str, int index, char keyEnd, byte bReserve = 0) { CString cstring = StringManager.Instance.StaticString1024(); CString cstring2 = StringManager.Instance.StaticString1024(); while (index < str.Length) { if (str[index] == keyEnd) { break; } if (bReserve == 0) { cstring.Append(str[index]); } else { cstring2.ClearString(); cstring2.Append(str[index]); cstring.Insert(0, cstring2, 1); } index++; } return(cstring.ToString()); }
// Token: 0x06001BC4 RID: 7108 RVA: 0x00315998 File Offset: 0x00313B98 public void GetLegionHintStr(byte heroEnhance, ref Skill skill, ref CString Content, byte RankStr = 0) { CString cstring = StringManager.Instance.StaticString1024(); CString cstring2 = StringManager.Instance.StaticString1024(); cstring.Append(Content); float num = (float)skill.HurtValue + (float)((ushort)this.LegionRankMagnifation[(int)(heroEnhance - 1)] * skill.HurtIncreaseValue) / 1000f; if (skill.HurtKind == 1) { GameConstants.GetEffectValue(Content, skill.HurtAddition, 0u, 7, 0f); Content.IntToFormat((long)((ushort)this.LegionRankMagnifation[(int)(heroEnhance - 1)] * skill.HurtIncreaseValue), 1, true); Content.AppendFormat("{0}"); } else if (skill.SkillType == 10) { GameConstants.GetEffectValue(Content, skill.HurtAddition, (uint)num, 1, 0f); } else { GameConstants.GetEffectValue(Content, skill.HurtAddition, 0u, 6, num * 100f); } if (RankStr > 0) { cstring2.StringToFormat(DataManager.Instance.mStringTable.GetStringByID(15u)); cstring2.IntToFormat((long)RankStr, 1, false); cstring2.StringToFormat(Content); if (skill.SkillType == 10) { cstring2.AppendFormat("<color=#ffff00ff>{0}{1} : {2}</color>"); } else { cstring2.AppendFormat("<color=#33eb67ff>{0}{1} : {2}</color>"); } } else { cstring2.StringToFormat(Content); if (skill.SkillType == 10) { cstring2.AppendFormat("<color=#ffff00ff>{0}</color>"); } else { cstring2.AppendFormat("<color=#33eb67ff>{0}</color>"); } } cstring2.Insert(0, cstring, -1); Content.ClearString(); Content.Append(cstring2); }
// Token: 0x06000142 RID: 322 RVA: 0x00015084 File Offset: 0x00013284 public string Transfer(string str, CString tmpStr) { this.TempStr.ClearString(); this.CharStr.ClearString(); tmpStr.ClearString(); this.ArabicRichEnd = 0; byte b = 0; byte b2 = 0; this.TextState = eTextCheck.Text_None; string empty = string.Empty; this.ArabicStr.ClearString(); int strLen = str.GetStrLen(); for (int i = 0; i < strLen; i++) { char c = str[i]; if (c == '\0') { break; } byte b3 = 0; if (this.IsArabic(c)) { this.ArabicStr.Append(c); if (this.CheckYenRule(str, i)) { b = 1; } } else { if (this.ArabicStr.Length > 0) { this.TempStr.ClearString(); this.TempStr.Append(ArabicFixerTool.Instance.FixLine(this.ArabicStr.ToString(), false)); tmpStr.Insert(0, this.TempStr, this.TempStr.Length); this.ArabicStr.ClearString(); } for (int j = 0; j < this.ReplaceStr[0].Length; j++) { if (this.ReplaceStr[0][j] == c) { c = this.ReplaceStr[1][j]; this.TempStr.ClearString(); this.TempStr.Append(c); tmpStr.Insert(0, this.TempStr, this.TempStr.Length); b3 = 1; break; } } if (b3 != 1) { if ((c >= '٠' && c <= '٩') || (c >= '۰' && c <= 'ۺ')) { tmpStr.Insert(0, this.PraseArabicNumber(str, ref i), this.TempStr.Length); } else if (c == '<') { tmpStr.Insert(0, this.PraseRichText(str, ref i), this.TempStr.Length); } else if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) { tmpStr.Insert(0, this.PraseNumber(str, ref i), this.TempStr.Length); } else if (char.GetUnicodeCategory(c) == UnicodeCategory.Surrogate) { b2 = 1; tmpStr.Insert(0, this.Praseemotion(str, ref i), this.TempStr.Length); } else { this.TempStr.ClearString(); this.TempStr.Append(c); tmpStr.Insert(0, this.TempStr, this.TempStr.Length); } } } } if (b2 == 1) { this.TextState |= eTextCheck.Text_Emoticon; } else { this.TextState |= eTextCheck.Text_NonEmoticon; } if (b != 0) { this.TextState |= eTextCheck.Text_Arabic; if (this.ArabicStr.Length > 0) { this.TempStr.ClearString(); this.TempStr.Append(ArabicFixerTool.Instance.FixLine(this.ArabicStr.ToString(), false)); tmpStr.Insert(0, this.TempStr, this.TempStr.Length); } return(tmpStr.ToString()); } this.TextState |= eTextCheck.Text_NonArabic; if (b2 == 1) { tmpStr.ClearString(); tmpStr.Append(str); return(tmpStr.ToString()); } return(str); }
static void Main(string[] args) { CString customstring = new CString("qwerty"); // Строковое отображение: Console.WriteLine($"Строковое отображение: {customstring}"); // Отображение длины: Console.WriteLine($"Отображение длины: {customstring.Length}"); // Конвертация в массив Array: Console.WriteLine($"Конвертация в массив: [{string.Join(", ", customstring.ToArray())}]"); // Конкатенация со строкой: Console.WriteLine($"Конкатенация со строкой через .concat: {customstring.Concat("two")}"); // Строковое отображение: Console.WriteLine($"Строковое отображение: {customstring}"); // Конкатенация со строкой: Console.WriteLine($"Конкатенация со строкой через +: {customstring + "two"}"); // Строковое отображение: Console.WriteLine($"Строковое отображение: {customstring}"); // Умножение строки: Console.WriteLine($"Умножение строки на 3: {customstring * 3}"); // Присвоение объекту CString объекта типа string: customstring = "qwerty"; // Intsert: customstring.Insert(0, "qwerty"); Console.WriteLine($"Insert в строку: {customstring}"); //Поиск по строке List <int> indexes = new List <int>(); int index = 0; while (index >= 0) { index = customstring.FindNext("qw"); if (index >= 0) { indexes.Add(index); } } //Использование индексатора Console.WriteLine($"Отображение индексов из строки {customstring}:"); foreach (int i in indexes) { Console.WriteLine($"Индекс {i}->{i}+1: {customstring[i]}{customstring[i + 1]}"); } indexes.Clear(); //Поиск по строке справа index = 0; while (index >= 0) { index = customstring.RFindNext("qw"); if (index >= 0) { indexes.Add(index); } } //Использование индексатора Console.WriteLine($"Отображение индексов из строки {customstring}:"); foreach (int i in indexes) { Console.WriteLine($"Индекс {i}->{i}+1: {customstring[i]}{customstring[i + 1]}"); } Console.Read(); }