c#控制台怎样输入密码给字符串加密再输出加密后的字符串
1个回答
展开全部
public static string a(string s)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.Length; i++)
{
int t=Convert.ToInt32(s[i]);
if (t>= 48 &&t<= 57)
{
sb.Append('$');
}
sb.Append(s[i]);
}
return sb.ToString();
}
static void Main(string[] args)
{
string s = "901s455s8se65f7";
string t = a(s);
}
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.Length; i++)
{
int t=Convert.ToInt32(s[i]);
if (t>= 48 &&t<= 57)
{
sb.Append('$');
}
sb.Append(s[i]);
}
return sb.ToString();
}
static void Main(string[] args)
{
string s = "901s455s8se65f7";
string t = a(s);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询