解析字符串 - 换行符的结束索引应该是什么?
Your request for ...
Good morning Mr Praneel PIDIKITI
you have succ.....
这是我的字符串,我想解析该字符串以获得值 Praneel PIDIKITI 我正在使用
int begin_index = 0;
int end_index = 0;
String startkeyword = "Good morning";
String endKeyword = " ???";
int main_begin_index = lines[i].indexOf(startkeyword, begin_index);
begin_index = main_begin_index;
end_index = lines[i].indexOf(endKeyword, begin_index);
String Name= lines[i].substring(begin_index + startkeyword.length(), end_index).trim();
我的 endKeyword 应该是什么,因为它是行尾??? 谁能帮助我....
Your request for ...
Good morning Mr Praneel PIDIKITI
you have succ.....
This is my string i want to parse this string in order to get the value Praneel PIDIKITI
i am using
int begin_index = 0;
int end_index = 0;
String startkeyword = "Good morning";
String endKeyword = " ???";
int main_begin_index = lines[i].indexOf(startkeyword, begin_index);
begin_index = main_begin_index;
end_index = lines[i].indexOf(endKeyword, begin_index);
String Name= lines[i].substring(begin_index + startkeyword.length(), end_index).trim();
What should be my endKeyword as it is the end of the line ???
can anyone help me ....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为此,您最好使用正则表达式。
You may be better off using Regexp for this.