substring and substr String methods

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 มี.ค. 2018
  • Two other String methods that are commonly used are substr and substring.
    These methods allow you to extract a portion of the original string upon which the method was called.
    The return value of the method is the extracted portion of the string.
    Code GIST: gist.github.com/prof3ssorSt3v...

ความคิดเห็น • 18

  • @alirezajabbari1263
    @alirezajabbari1263 8 หลายเดือนก่อน

    Thank you for the simple explanation!

  • @maicon484
    @maicon484 ปีที่แล้ว

    Thank you, it helped me a lot...direct from Brazil

  • @rotrose7531
    @rotrose7531 4 ปีที่แล้ว +4

    Thank you, simple and to the point, love it.

  • @Colstonewall
    @Colstonewall 6 ปีที่แล้ว +3

    Thanks, Steve.

  • @chesterxp508
    @chesterxp508 2 ปีที่แล้ว +1

    Another very cool tutorial!

  • @nuregal7699
    @nuregal7699 4 ปีที่แล้ว +2

    Simple and extremely helpful, thanks

  • @MoodyHL
    @MoodyHL ปีที่แล้ว

    perfectly explained

  • @b.naveenkumar7662
    @b.naveenkumar7662 4 ปีที่แล้ว +1

    Steve it's beatuiful explanation

  • @gregoroza22
    @gregoroza22 3 ปีที่แล้ว +1

    simple and helpful, thanks!

  • @sevdamurat4455
    @sevdamurat4455 4 ปีที่แล้ว +1

    ok definitions at the comments are very helpful

  • @mi5956
    @mi5956 4 ปีที่แล้ว +1

    THANK YOU

  • @tinpham6413
    @tinpham6413 3 ปีที่แล้ว +1

    =)) you make me realize "substr" called "Sub Start" not "Sub String". Because of that I have confuse between these two but... yeah no more

  • @hanswurst5426
    @hanswurst5426 4 ปีที่แล้ว +1

    how can I let an ASCII Art run backwards (right to left) with cout endl with a substr?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 ปีที่แล้ว +1

      You can flip a string in JS by turning it into an Array with the split( ) method and then the array reverse( ) method and then the join( ) method to put it back together. cout and endl do not exist in Javascript those are things in Java and C++.

  • @RedEyedJedi
    @RedEyedJedi 4 ปีที่แล้ว +1

    Warning: Although String.prototype.substr(…) is not strictly deprecated (as in "removed from the Web standards"), it is considered a legacy function and should be avoided when possible. It is not part of the core JavaScript language and may be removed in the future. If at all possible, use the substring() method instead. Cited from: MDN

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 ปีที่แล้ว +2

      Yeah. The bastards. I liked substr.

    • @RedEyedJedi
      @RedEyedJedi 4 ปีที่แล้ว +2

      @@SteveGriffith-Prof3ssorSt3v3 Haha, me too mate, although it's just as easy to make your own version using substring.

  • @honkingcandy639
    @honkingcandy639 2 ปีที่แล้ว

    speak clearly bro :(