当前位置:网站首页>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
边栏推荐
- What does project management really manage?
- New trends of China's national tide development in 2022
- Spark - understand partitioner in one article
- 远程办公期间,项目小组微信群打卡 | 社区征文
- 后疫情时代,云计算如何为在线教育保驾护航
- Smart streetlights | cloud computing lights up the "spark" of smart cities
- [Android, kotlin, tflite] mobile device integration depth learning light model tflite (image classification)
- 基金管理人公司治理和风险管理
- "More Ford, more China" saw through the clouds, and the orders of Changan Ford's flagship products exceeded 10000
- How to design test cases
猜你喜欢
![[无线通信基础-13]:图解移动通信技术与应用发展-1-概述](/img/1d/62e55f1b5445d7349ec383879f4275.png)
[无线通信基础-13]:图解移动通信技术与应用发展-1-概述

项目管理到底管的是什么?
![CesiumJS 2022^ 源码解读[6] - 三维模型(ModelExperimental)新架构](/img/ce/519778cd731f814ad111d1e37abd10.png)
CesiumJS 2022^ 源码解读[6] - 三维模型(ModelExperimental)新架构

Introduction to digital transformation solutions for enterprises going to sea

Redis - 01 cache: how to use read cache to improve system performance?

基于kubernetes平台微服务的部署

As the public cloud market enters the deep water, can the calm Amazon cloud still sit still?

Some memory problems summarized

How to change the win11 computer name? Win11 method of changing computer name

latex字母头顶两个点
随机推荐
[无线通信基础-13]:图解移动通信技术与应用发展-1-概述
异步過渡方案—Generator
Introduction to machine learning compilation course learning notes lesson 2 tensor program abstraction
Classic case of multithreading
理想中的接口自动化项目
Spark - understand partitioner in one article
What does the software test report contain? How to obtain high quality software test reports?
Yolo target detection
35 giant technology companies jointly form the meta universe standard Forum Organization
【Android,Kotlin,TFLite】移动设备集成深度学习轻模型TFlite(物体检测篇)
项目管理到底管的是什么?
CNN经典网络模型详解-LeNet-5(pytorch实现)
多線程經典案例
基金客户服务
What are database OLAP and OLTP? Same and different? Applicable scenarios
Solution to the conflict between unique index and logical deletion
[golang] golang实现截取字符串函数SubStr
Solve arm_ release_ ver of this libmali is ‘g2p0-01eac0‘,rk_ so_ Ver is' 4 ', libgl1 mesa dev will not be installed, and there are unsatisfied dependencies
How does win11 optimize services? Win11 method of optimizing service
AtCoder Beginner Contest 255