3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
C# 正確抓出/計算 UTF8字串長度 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CS_UTF8 { class Program { static void Main(string[] args) { String StrEN, StrTW, StrCN; StrEN = "English name"; StrTW = "英文名稱"; StrCN = "英文名称"; byte[] buf01 = Encoding.UTF8.GetBytes(StrEN);//12 byte byte[] buf02 = Encoding.UTF8.GetBytes(StrTW);//12 byte byte[] buf03 = Encoding.UTF8.GetBytes(StrCN);//12 byte } } }

本文由jashliaoeuwordpress提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦