Write a StringBuffer replace() Program

Write a StringBuffer replace() Program

Program
import java.util.Scanner;
public class Main
{
    public static void main(String args[])
    {
        String s;
        Scanner sc=new Scanner(System.in);
        System.out.println("Enter String : ");
        s=sc.nextLine();
        StringBuffer s1=new StringBuffer(s);
        System.out.println(s1.replace(1,7,"kumar"));
    }
}


Output:

Enter String : Sateesh
Skumar


Strings Handling In Java



More Questions


191 . Write a StringBuffer replace() Program
192 . Write a StringBuilder length program
193 . Write a StringBuilder charAt() method program
194 . Write a StringBuilder toLowerCase() Program
195 . Write a StringBuilder toUpperCase() program
196 . Write a StringBuilder concat() program
197 . Write a StringBuilder compareTo program
198 . Write a StringBuilder compareToIgnoreCase() Program
199 . Write a StringBuilder equals program
200 . Write a StringBuilder equalsIgnoreCase() program
201 . Write a StringBuilder startsWith() program