public static int ReverseIndexOf(string s, char c)
{
Char[] tempChar = s.ToCharArray();
Array.Reverse(tempChar);
return (new string(tempChar).IndexOf(c) == -1 ? s.Length : s.Length - new string(tempChar).IndexOf(c));
}
<summary> restore missing Cr for comments background: BE will lost Cr when save and get comments. GUI control show multi-line content must use CrLf. Phase 3 by suchun </summary> <param name="OrgStr"></param> <returns></returns> OrgStr)
{ .IsNullOrEmpty(OrgStr))
{ );
} else .Empty;
字符串操作技巧
本文介绍了一种用于查找字符串中特定字符最后出现位置的方法,并提供了一个实用的C#代码示例。此外,还展示了一个修复文本中换行符问题的函数,确保了在不同环境下文本显示的一致性。
5981

被折叠的 条评论
为什么被折叠?



