有一string A=“PN”,如何转成string B“80;78;” ,又如何换回来。P的ASCII 十进制借为80字符串转换
解决方案 »
- 未注册 Microsoft.Jet.OLEDB.4.0的问题
- 求助Image控件问题
- CuteEditor粘贴Word文件档报错问题
- 索引超出范围???
- 将CS文件编译成DLL文件出错
- DataGridView 中怎么读取SQLserver数据库的数据,进行显行.
- 求高手 c#运行后 总是出现同一个窗体
- 关于C#人脸识别,与图片比对
- 求帮忙写个算法
- WinForm下主从表的显示问题(急)
- VS2010用C#访问SQL数据库,想实现用listbox1控件显示表1的某列,listbox2控件显示表2的某列,代码如下
- C# WinCE平台下怎样实现button按钮的mouseup mousedown事件
string B = String.Join(";", A.ToCharArray().Select(x => (int)x).ToArray());
string C = String.Join("", B.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries).Select(x => (char)Convert.ToInt32(x)).ToArray());
编译完,显示The best overloaded method match for 'string.Join(string, string[])' has some invalid arguments,
还有Argument '2': cannot convert from 'string' to 'string[]'
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string s = "PN";
string B = string.Join(";", s.Select(x => Convert.ToString((int)x)).ToArray()) + ";";
Console.WriteLine(B);
string A = new string(B.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries).Select(x => (char)int.Parse(x)).ToArray());
Console.WriteLine(A);
}
}
}80;78;
PN
Press any key to continue . . .