Skip to content

Commit f824882

Browse files
committed
Add helper to check whether a line starts with a line time tag
1 parent f0f5e56 commit f824882

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

LrcParser/Parser/Lrc/Utils/LrcStartTimeUtils.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ namespace LrcParser.Parser.Lrc.Utils;
88

99
public static class LrcStartTimeUtils
1010
{
11+
/// <summary>
12+
/// Check if the line starts with a line time tag.
13+
/// </summary>
14+
/// <param name="line">The lyrics line in the LRC format.</param>
15+
/// <returns>
16+
/// <c>true</c> if the line starts with a line time tag, <c>false</c> otherwise.
17+
/// </returns>
18+
public static bool StartsWithLineTimeTag(string line)
19+
{
20+
var match = TimeTagUtils.LINE_TIME_TAG_REGEX.Match(line);
21+
return match.Success && match.Index == 0;
22+
}
23+
1124
/// <summary>
1225
/// Split an LRC lyrics line into parsed line time tags and the lyric text.
1326
/// </summary>

0 commit comments

Comments
 (0)