[Chk] - Use helper class to detect if char is digit [0-9].

This commit is contained in:
Ivandro Ismael 2016-08-12 13:39:24 +01:00
parent 954991ede7
commit b4271692db
No known key found for this signature in database
GPG Key ID: A8832757DEFB7EDC
2 changed files with 2 additions and 1 deletions

View File

@ -46,6 +46,7 @@
<Compile Include="BluRaySup\PaletteInfo.cs" /> <Compile Include="BluRaySup\PaletteInfo.cs" />
<Compile Include="BluRaySup\ToolBox.cs" /> <Compile Include="BluRaySup\ToolBox.cs" />
<Compile Include="BmpReader.cs" /> <Compile Include="BmpReader.cs" />
<Compile Include="CharUtils.cs" />
<Compile Include="Configuration.cs" /> <Compile Include="Configuration.cs" />
<Compile Include="ContainerFormats\AviRiffData.cs" /> <Compile Include="ContainerFormats\AviRiffData.cs" />
<Compile Include="ContainerFormats\Ebml\Element.cs" /> <Compile Include="ContainerFormats\Ebml\Element.cs" />

View File

@ -143,7 +143,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
if (end - start > 0) if (end - start > 0)
text = _codePage.GetString(buffer, start, end - start); text = _codePage.GetString(buffer, start, end - start);
} }
if (text.Length > 4 && text[0] == 0x1f && text[1] == 'R' && text[4] == '.' && "0123456789".Contains(text[2]) && "0123456789".Contains(text[3])) if (text.Length > 4 && text[0] == 0x1f && text[1] == 'R' && text[4] == '.' && CharUtils.IsDigit(text[2]) && CharUtils.IsDigit(text[3]))
{ {
text = text.Remove(0, 5); text = text.Remove(0, 5);
} }