【问题标题】:getting substring out of string and an integer, and creating new word within the integer parameters从字符串和整数中获取子字符串,并在整数参数中创建新单词
【发布时间】:2017-10-28 18:23:06
【问题描述】:

对于我的 java 类,我需要创建一个从适合参数的字符串中获取单词的方法

ex:“行尸走肉”,3 返回“the”。

【问题讨论】:

标签: java


【解决方案1】:
String word = "the walking dead";
String result = word.substring(0, 3);

试试看

【讨论】:

    猜你喜欢
    • 2020-02-08
    • 2022-10-16
    • 2012-12-11
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    • 2010-11-23
    • 1970-01-01
    • 2018-10-13
    相关资源
    最近更新 更多