String类的方法 replace (CharSequence srt1, CharSequence srt2)返回一个新的字符串,它是通过用srt2替换此字符串中出现的所有 srt1得到的

String类的方法 replace (CharSequence srt1, CharSequence srt2)返回一个新的字符串,它是通过用srt2替换此字符串中出现的所有 srt1得到的


相关考题:

在Java语言中,能够实现字符串连接的方法是()A.String sub string(intstart point)B.String concat(Strings)C.String replace(charold,charnew)D.String trim()

下列方法中,不属于类 String 的方法是A ) tolowerCase ()B ) valueof ()C ) charAt ()D ) append ()

下面程序的输出结果是什么? class Foo{ static void change(String s){ s=s.replace('j','l'); } public static void main(String args[]){ String s="java"; change(s); System.out.println(s); } }()A.lavaB.javaC.编译错误D.运行时出现异常

下列程序的输出结果是( )。 public class Test { public static void main (String[] args) { String s="hello"; s.replace ('r','m'); System.out.println(s); } }A.helloB.HELLOC.hemmoD.HEMMO

下面( )不是String类提供的合法的方法。A、equals(String)B、trim()C、append()D、indexOf()

Public class test (  Public static void stringReplace (String text)  (  Text = text.replace (‘j’ , ‘i’);  )  public static void bufferReplace (StringBuffer text)  (  text = text.append (“C”)  )   public static void main (String args[]}  (  String textString = new String (“java”);  StringBuffer text BufferString = new StringBuffer (“java”);  stringReplace (textString);  BufferReplace (textBuffer);  System.out.printLn (textString + textBuffer);  )  )   What is the output?()

String a = “ABCD”;  String b = a.toLowerCase();  b.replace(‘a’, ‘d’);  b.replace(‘b’, ‘c’);  System.out.println(b);   What is the result? () A、 abcdB、 ABCDC、 dccdD、 dcbaE、 Compilation fails.F、 An exception is thrown at runtime.

下列类Account的构造方法中,声明正确的是?()    A、Account (String name)()B、Account (String  name)C、Account (name)()D、NewAccount (String name)()

下列不是 String 类的方法的是()A、charAt(int index)B、indexOf(String s)C、beginWith(String s)D、endsWith(String s)

File类的方法中,用于列举某目录下的子目录及文件的方法是()A、long length()B、long lastModified()C、String [] list()D、String getName()

在标准String类的方法中,能去除某字符串中的首、尾空格的方法是()。A、trim()B、replace()C、regionMatches()D、replaceAll()

String类中用于返回字符串字符个数的方法是()

String类的ToLower方法可以把文本值转换为大写。()

下面哪个不是String类的方法?()A、subString()B、startsWith()C、toString()D、toUpperCase()

String类和StringBuffer类的区别是什么?StringBuffer类提供了哪些独特的方法?

Which methods from the String and StringBuffer classes modify the object on which they are called?()  A、The charAt() method of the String class.B、The toUpperCase() method of the String class.C、The replace() method of the String class.D、The reverse() method of the StringBuffer class.E、The length() method of the StringBuffer class.

public class MyLogger {  private StringBuilder logger = new StringBuuilder();  public void log(String message, String user) {  logger.append(message);  logger.append(user);  }  }  The programmer must guarantee that a single MyLogger object works properly for a multi-threaded system. How must this code be changed to be thread-safe?() A、 synchronize the log methodB、 replace StringBuilder with StringBufferC、 No change is necessary, the current MyLogger code is already thread-safe.D、 replace StringBuilder with just a String object and use the string concatenation (+=) within the log method

单选题下列类Account的构造方法中,声明正确的是?()AAccount (String name)()BAccount (String  name)CAccount (name)()DNewAccount (String name)()

判断题String类的方法 replace (CharSequence srt1, CharSequence srt2)返回一个新的字符串,它是通过用srt2替换此字符串中出现的所有 srt1得到的A对B错

单选题下面()不是String类提供的合法的方法。Aequals(String)Btrim()Cappend()DindexOf()

单选题public class MyLogger {  private StringBuilder logger = new StringBuuilder();  public void log(String message, String user) {  logger.append(message);  logger.append(user);  }  }  The programmer must guarantee that a single MyLogger object works properly for a multi-threaded system. How must this code be changed to be thread-safe?()A synchronize the log methodB replace StringBuilder with StringBufferC No change is necessary, the current MyLogger code is already thread-safe.D replace StringBuilder with just a String object and use the string concatenation (+=) within the log method

单选题String a = “ABCD”;  String b = a.toLowerCase();  b.replace(‘a’, ‘d’);  b.replace(‘b’, ‘c’);  System.out.println(b);   What is the result? ()A abcdB ABCDC dccdD dcbaE Compilation fails.F An exception is thrown at runtime.

单选题You are creating a Windows Communication Foundation (WCF) service that implements operations in a RESTful manner.You need to add a delete operation. You implement the delete method as follows. string void DeleteItems(string id);You need to configure WCF to call this method when the client calls the service with the HTTP DELETE operation. What should you do?()A Add the WebInvoke(UriTemplate = /Items/{id},Method=DELETE) attribute to the operation.B Add the HttpDelete attribute to the operation.C Replace the string parameter with a RemovedActivityAction parameter.D Replace the return type with RemovedActivityAction.

单选题Which methods from the String and StringBuffer classes modify the object on which they are called?()AThe charAt() method of the String class.BThe toUpperCase() method of the String class.CThe replace() method of the String class.DThe reverse() method of the StringBuffer class.EThe length() method of the StringBuffer class.

问答题String类和StringBuffer类的区别是什么?StringBuffer类提供了哪些独特的方法?

填空题Public class test (    Public static void stringReplace (String text) (    Text = text.replace („j„ , „i„);    )      public static void bufferReplace (StringBuffer text) (    text = text.append (“C”)   )      public static void main (String args ){  String textString = new String (“java”);    StringBuffer text BufferString = new StringBuffer (“java”);      stringReplace (textString);    BufferReplace (textBuffer);      System.out.printIn (textString + textBuffer);    }   )   What is the output?()

单选题下列不是 String 类的方法的是()AcharAt(int index)BindexOf(String s)CbeginWith(String s)DendsWith(String s)