摘要: string转byte[]: byte[] byteArray = System.Text.Encoding.Default.GetBytes ( str ); byte[]转string: string str = System.Text.Encoding.Default.GetString ( 阅读全文
posted @ 2021-10-20 20:09 初级开发 阅读(272) 评论(0) 推荐(0)
摘要: 一、 1、取字符串的前i个字符 (1)string str1=str.Substring(0,i); (2)string str1=str.Remove(i,str.Length-i); 2、去掉字符串的前i个字符 string str1=str.Remove(0,i); string str1=s 阅读全文
posted @ 2021-10-20 20:09 初级开发 阅读(534) 评论(0) 推荐(0)
摘要: 今天在开发中遇到有的机器自动保存以后编码格式会变成utf-8 带bom 导致读取不到txt文件数据,然后变成ansi 就好了 阅读全文
posted @ 2020-06-04 09:49 初级开发 阅读(123) 评论(0) 推荐(0)
摘要: mmm = msg; mmm = mmm.Replace("\r", ""); //删除袭\r mmm = mmm.Replace("\n", "");//删除\n mmm = mmm.Replace("\t", "");//删除\t mmm = mmm.Replace(" ", "");//删除空 阅读全文
posted @ 2020-06-01 11:45 初级开发 阅读(677) 评论(0) 推荐(0)
摘要: using Newtonsoft.Json; using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Net;using System.Text;using System 阅读全文
posted @ 2020-06-01 08:44 初级开发 阅读(676) 评论(0) 推荐(0)