Problem Statement : To search and replace a pattern of string with another.

Algorithm

1) Start.
2) Initialize the three strings s1,s2,and s3.
3) Read the string.
4) Enter the pattern to be searched.
5) Check whether the given pattern in the string using
6) s1.substring(s2).
7) Replace the pattern with another string using
8) s1=s1.concat(s2).
9) Print the result.
10) Stop.