java - Java how to remove fields into a String value?
问题描述
Good afternoon, I would like to know what is the easiest function that would fix my problem.
InputStream in = socket.getInputStream();
byte[] buffer = new byte[2048];
int received = in.read(buffer, 0, buffer.length);
messageFromServer = new String(buffer, 0, received); // F108102200000002E00002940001...
the String MessageFromServer receives a value from the server via a socket, and I would like to treat that message excluding the first 2 characters of it. In addition to, for example, excluding the string in the field (33 to 40) (EXAMPLE). I saw the replace function but I don't know if it is the best one to use, could someone answer me by passing an example? Thank you.
解决方案
推荐阅读
- html - 如何在嵌套 SVG 中设置参考点?
- vb.net - 如何从 Txt 文件创建和填充数据表
- javascript - 在 D3 中使用不同数据集更新数据的问题
- java - 尝试在没有“硬编码”的情况下创建多个用户
- java - Vert.x Http 请求未将参数分配为配置
- python - 如何使用 Python 3.6.5 在 TensorFlow Keras API 中修复“ModuleNotFoundError:没有名为“tensorflow._api”的模块
- php - WP-ADMIN 重定向循环
- python - 在python中生成高斯时间序列
- android - 让我的应用与 Google Home 中的 Google Assistant 对话
- mysql - Laravel Eloquent 多个 AND/OR 语句