2024-05-14 14:26:33 +00:00
|
|
|
|
namespace ColdMint.scripts.utils;
|
|
|
|
|
|
2024-06-05 13:38:45 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>StrUtils</para>
|
|
|
|
|
/// <para>字符串工具</para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class StrUtils
|
2024-05-14 14:26:33 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/// <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)..];
|
|
|
|
|
}
|
|
|
|
|
}
|