c#代码实现字符反转排序
public static void Execute(Dictionary<string, string> stringDic,Dictionary<string, List<string>> listDic, Dictionary<string, int> intDic)
{
char[] cs = stringDic["邮箱"].ToCharArray();
char temp;
int len = cs.Length;
for (int i = 0; i < cs.Length / 2 ; i++)
{
temp = cs[i];
cs[i] = cs[len - 1 - i];
cs[len - 1 - i] = temp;
}
stringDic["邮箱"] = new string(cs);
}
比如采集到的邮箱值:rb.psu.prmf@reviloc 真实邮箱是coliver@fmrp.usp.br 所以就需要借助上述代码实现反转字符效果。
附件脚本参考下载:
c#语句功能扩展:
字母顺序排序:
string[] words = { "wer", "dfs", "asdw" };
var sortedWords = from w in words
orderby w
select w;
foreach (var w in sortedWords)
{
Console.WriteLine(w);
}
var sortedWords = from w in words
orderby w
select w;
foreach (var w in sortedWords)
{
Console.WriteLine(w);
}
数字大小排序:
var k = new int[] {5,7,3};
var sortedValues = k.OrderBy(v => v).ToList();
var sortedValues = k.OrderBy(v => v).ToList();