mirror of
https://github.com/OpenLogics/MewtocolNet.git
synced 2025-12-06 03:01:24 +00:00
Moved MewExplorer to a new repo
This commit is contained in:
@@ -3,6 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MewTerminal;
|
||||
@@ -24,7 +25,7 @@ internal static class Helpers {
|
||||
|
||||
foreach (var prop in props) {
|
||||
|
||||
if(isFirst) table.AddColumn(prop.Name);
|
||||
if(isFirst) table.AddColumn(prop.Name.SplitCamelCase());
|
||||
|
||||
var propVal = prop.GetValue(item);
|
||||
|
||||
@@ -34,6 +35,10 @@ internal static class Helpers {
|
||||
strVal = string.Join(" ", bArr.Select(x => x.ToString("X2")));
|
||||
}
|
||||
|
||||
if (propVal is string[] sArr) {
|
||||
strVal = string.Join(", ", sArr);
|
||||
}
|
||||
|
||||
strVal = strVal.Replace("[", "");
|
||||
strVal = strVal.Replace("]", "");
|
||||
|
||||
@@ -51,4 +56,10 @@ internal static class Helpers {
|
||||
|
||||
}
|
||||
|
||||
private static string SplitCamelCase (this string str) {
|
||||
|
||||
return Regex.Replace(Regex.Replace(str, @"(\P{Ll})(\P{Ll}\p{Ll})", "$1 $2"), @"(\p{Ll})(\P{Ll})", "$1 $2");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user