public static string RemoveLogMessageType( LogMessageType type, string logLine, bool withoutTimestamp = false) { /* * 新しいログの書式 * [00:32:16.798] ActionEffect 15:102DB8BA:Naoki Yoshida:BA:士気高揚の策:102DB8BA:Naoki Yoshida:... */ var timestampLength = withoutTimestamp ? 0 : 15; var result = logLine; if (string.IsNullOrEmpty(result)) { return(result); } if (logLine.Length < timestampLength) { return(result); } var messageTypeNoIndex = timestampLength + type.ToStringEx().Length + 1; if (logLine.Length < messageTypeNoIndex) { return(result); } result = !withoutTimestamp ? $"{logLine.Substring(0, timestampLength - 1)} {logLine.Substring(messageTypeNoIndex)}" : logLine.Substring(messageTypeNoIndex); return(result); }