#66. 字符串单词替换

    ID: 66 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatString-3gesp3字符串

字符串单词替换

Word Replacement

Background

Congcong is processing some text data, and he needs to perform specific word replacements.

Problem Description

Given a string, return a string where every appearance of the lowercase word "is" has been replaced with "is not". The word "is" should not be immediately preceded or followed by a letter -- so for example the "is" in "this" does not count. (Note: Character.isLetter(char) tests if a char is a letter.)

Input Format

The input consists of a single line, which is a string.

s

Output Format

Output the modified string.

result_s

Sample

is test
is not test
is-is
is not-is not
This is right
This is not right

Sample Explanation

  • For Sample 1, in the string "is test\