• 2022-06-06
    var str="Hello world!";想要从str变量中提起出"world",下面的代码正确的是( )
    A: str.substring(6,11)
    B: str.substring(7,11)
    C: str.substr(7,4)
    D: str.substr(6,5)
  • A,D

    内容

    • 0

      var str="hello world";document.write(str.substr(3,5));document.write(",");document.write(str.substring(3,5));输出结果为 A: lo wo,lo B: lo,lo wo C: llo,llo D: lowo,lo

    • 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

      智慧职教: 找出下面的代码中的错误```1. var str = 'hello';2. console.log(str.substr(5);```

    • 3

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

    • 4

      String str = "HelloWorld!";System.out.print(str.subString(5,10)); A: oWorl B: oWorld C: World D: World!