mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-17 00:31:42 +02:00
Configuration
Core
Bridge
Controls
Handling
Notification
Other
Utils
BrowserCache.cs
BrowserProcesses.cs
BrowserUtils.cs
CommandLineArgsParser.cs
MemoryUsageTracker.cs
NativeMethods.cs
StringUtils.cs
WindowsUtils.cs
FormBrowser.Designer.cs
FormBrowser.cs
FormBrowser.resx
TrayIcon.Designer.cs
TrayIcon.cs
Data
Plugins
Properties
Resources
Updates
bld
lib
subprocess
tests
.gitignore
LICENSE.md
Program.cs
README.md
Reporter.cs
TweetDuck.csproj
TweetDuck.sln
TweetDuck.sln.DotSettings
_postbuild.bat
packages.config
21 lines
770 B
C#
21 lines
770 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Text.RegularExpressions;
|
|
|
|
namespace TweetDuck.Core.Utils{
|
|
static class StringUtils{
|
|
public static string ExtractBefore(string str, char search, int startIndex = 0){
|
|
int index = str.IndexOf(search, startIndex);
|
|
return index == -1 ? str : str.Substring(0, index);
|
|
}
|
|
|
|
public static int[] ParseInts(string str, char separator){
|
|
return str.Split(new char[]{ separator }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
|
|
}
|
|
|
|
public static string ConvertPascalCaseToScreamingSnakeCase(string str){
|
|
return Regex.Replace(str, @"(\p{Ll})(\P{Ll})|(\P{Ll})(\P{Ll}\p{Ll})", "$1$3_$2$4").ToUpper();
|
|
}
|
|
}
|
|
}
|