当前位置:网站首页>C language array interception, C string by array interception method (c/s)
C language array interception, C string by array interception method (c/s)
2022-06-30 23:07:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
private void button1_Click(object sender, EventArgs e) {
string[] aa = this.GetYouhouComment(“aaa king ああああああddddd”, 4);
}
/// Metatext Columns
/// Truss number
/// obtain する It turns out
private string[] GetYouhouComment(string PValue, int PLenth) {
string[] result = new string[5];
string shiteiResult = PValue.Replace(“,”, string.Empty);
// Text columns へ Content を Replacement management を That's ok う.
int byteCount = Encoding.GetEncoding(932).GetByteCount(shiteiResult);
int j = 0;
// Appoint する Truss number >= Text columns の Truss number の Occasion
if (PLenth >= byteCount) {
shiteiResult = string.Empty.PadRight(PLenth – byteCount) + shiteiResult;
result[j] = shiteiResult;
// outside の Occasion
} else {
string strValue = string.Empty;
string strCompare = string.Empty;
// Appoint する Truss number な Text columns を obtain する.
for (int i = 0; i < shiteiResult.Length; i++) {
strCompare = shiteiResult.Substring(i, 1);
// GetEncodingメソッドの Arguments ’932’がSJISを in します.
if (Encoding.GetEncoding(932).GetByteCount(strValue) +
Encoding.GetEncoding(932).GetByteCount(strCompare) > PLenth) {
if (j < 5) {
result[j] = strValue;
strValue = strCompare;
j = j + 1;
} else {
break;
}
} else {
strValue = strValue + shiteiResult.Substring(i, 1);
if (i == shiteiResult.Length – 1) {
result[j] = strValue;
}
}
}
}
return result; }
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/132229.html Link to the original text :https://javaforall.cn
边栏推荐
- latex中 & 号什么含义?
- 企业出海数字化转型解决方案介绍
- Youfu network hybrid cloud accelerates enterprise digital transformation and upgrading
- 微信小程序通过点击事件传参(data-)
- Fastjson V2 简单使用手册
- [Android, kotlin, tflite] mobile device integration deep learning light model tflite (object detection)
- Introduction to digital transformation solutions for enterprises going to sea
- JMeter cross thread parameter association requires no script
- Cloud games | cloud computing drives the game industry into a "new era"
- 项目管理到底管的是什么?
猜你喜欢

Classic case of multithreading

How to design test cases

理想中的接口自动化项目

How to use dataant to monitor Apache APIs IX

基于kubernetes平台微服务的部署

多線程經典案例

【Android,Kotlin,TFLite】移动设备集成深度学习轻模型TFlite(物体检测篇)

Achieve secure data sharing among multiple parties and solve the problem of asymmetric information in Inclusive Finance

实现多方数据安全共享,解决普惠金融信息不对称难题

JMeter cross thread parameter association requires no script
随机推荐
在线客服聊天系统源码_美观强大golang内核开发_二进制运行傻瓜式安装_附搭建教程...
电商秒杀系统
Strictly minor spanning tree
[无线通信基础-13]:图解移动通信技术与应用发展-1-概述
In depth analysis of Apache bookkeeper series: Part 4 - back pressure
Where can I find the computer device manager
AtCoder Beginner Contest 255
零样本和少样本学习
How to develop the exchange system? Mature technology case of digital currency exchange system development
异步過渡方案—Generator
leetcode:104. 二叉树的最大深度
严格次小生成树
Redis' cache penetration, cache breakdown and cache avalanche
Kubevela 1.4: make application delivery safer, easier to use, and more transparent
Qlineedit of QT notes (74) specifies the input type
股票开户要如何办理呢?办理手机开户安全吗
【Android,Kotlin,TFLite】移动设备集成深度学习轻模型TFlite(图像分类篇)
latex字母头顶两个点
深入解析 Apache BookKeeper 系列:第四篇—背压
Ctfshow permission maintenance