快速将下划线字段改为驼峰字段
//ALTER TABLE `csp_server_order` MODIFY COLUMN `address` varchar(256) NULL COMMENT '详细地址';
foreach (string s in lines)
{
Match fieldMatch = Regex.Match(s, @"COLUMN\s`(\w*)`", RegexOptions.IgnoreCase);
if (fieldMatch.Success) {
string fieldName = fieldMatch.Groups[1].Value;
if (fieldName.Contains("_")) {
fieldName = Regex.Replace(fieldName,@"_(\w{1})",match=> match.Groups[1].Value.ToUpper());
}
list.Add(fieldName);
}
}
foreach (string s in lines)
{
Match fieldMatch = Regex.Match(s, @"COLUMN\s`(\w*)`", RegexOptions.IgnoreCase);
if (fieldMatch.Success) {
string fieldName = fieldMatch.Groups[1].Value;
if (fieldName.Contains("_")) {
fieldName = Regex.Replace(fieldName,@"_(\w{1})",match=> match.Groups[1].Value.ToUpper());
}
list.Add(fieldName);
}
}