Traveller/scripts/utils/StrUtils.cs
Cold-Mint 2fded22910
Attempt to serialize node data.
尝试序列化节点数据。
2024-05-14 22:26:33 +08:00

17 lines
433 B
C#

namespace ColdMint.scripts.utils;
public class StrUtils
{
/// <summary>
/// <para>Gets the last line of a string</para>
/// <para>获取某个字符串的最后一行</para>
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string GetLastLine(string str)
{
var index = str.LastIndexOf('\n');
return index == -1 ? str : str[(index + 1)..];
}
}