• 2022-06-12
    已知$str = " Hello World! ";下列说法正确的是:
    A: trim($str)结果是" Hello World!";
    B: ltrim($str)结果是"Hello World! ";
    C: trim($str)结果是" Hello World!";
    D: trim($str)结果是"Hello World!";
  • B,C,D

    内容

    • 0

      以下语句执行结果是()String str = " hello World ";System.out.println(str.trim()); A: hello World B: hello World C: helloWorld D: 程序异常

    • 1

      如何将字符串“Hello World”写入a.txt文件内?FILE *file; file = fopen("a.txt","w"); A: char str = "Hello World"; fputs(&str,file); B: char str = "Hello World"; fputc(&str,file); C: char str = "Hello World"; fput(&str,file); D: char str = "Hello World"; fputs(str,file);

    • 2

      下面代码的运行结果是( )。var str= "hello world" ;var str1=str.toUpperCase();var str2=str.toLowerCase() ;alert (str1) ;alert (str2) ; A: "HELLO WORLD","HELLO WORLD" B: "HELLO WORLD","hello world" C: "hello worl","HELLO WORLD" D: "hello world","hello world"

    • 3

      下列定义字符串类string对象的语句中,错误的是( )。 A: string str; B: string str( “Hello, world” ); C: string str = “Hello, world”; D: string str = ‘Hello, world’;

    • 4

      world = "world"str = 'hello'print str+world 的结果为 A: helloworld B: hello world C: hello "world" D: 语法错误