diff options
author | sr55 <[email protected]> | 2018-07-13 22:19:52 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2018-07-13 22:20:05 +0100 |
commit | 4756b8508d9322da84282421983714e2578d8227 (patch) | |
tree | 962bc53d6028cb432cd002b5431c63c4077c9fe6 /win/CS/HandBrakeWPF/Extensions | |
parent | 9b44cc7808d3d1e185a0ed517ac7d485e92cca93 (diff) |
WinGui: Few small updates to the EncodeTaskImportFactory
Diffstat (limited to 'win/CS/HandBrakeWPF/Extensions')
-rw-r--r-- | win/CS/HandBrakeWPF/Extensions/StringExtensions.cs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/win/CS/HandBrakeWPF/Extensions/StringExtensions.cs b/win/CS/HandBrakeWPF/Extensions/StringExtensions.cs index d3324a913..cf7e507aa 100644 --- a/win/CS/HandBrakeWPF/Extensions/StringExtensions.cs +++ b/win/CS/HandBrakeWPF/Extensions/StringExtensions.cs @@ -24,8 +24,17 @@ namespace HandBrakeWPF.Extensions public static string ToTitleCase(this string input)
{
TextInfo textInfo = new CultureInfo(CultureInfo.CurrentCulture.Name, false).TextInfo;
- return textInfo.ToTitleCase(input.ToLower());
-
+ return textInfo.ToTitleCase(input.ToLower());
+ }
+
+ public static int ToInt(this string input)
+ {
+ if (int.TryParse(input, out int value))
+ {
+ return value;
+ }
+
+ return 0;
}
}
}
|