java吧 关注:1,214,513贴子:12,661,027
  • 1回复贴,共1

The past is gone and static. Nothing we can do willchange it

只看楼主收藏回复

给定字符串“The past is gone and static. Nothing we can do willchange it. The future is before us and dynamic. Everything we do will affectit.”,请统计指定单词“we”出现的频率(次数),并将单词“we”全部改成“you”。
有没有大神帮个忙 跪谢


1楼2017-04-25 16:39回复
    1.先按we拆分字符串,数组的长度-1就是we的个数
    2.str.relpaceAll


    IP属地:吉林2楼2017-04-25 16:42
    回复