Adding more Logic to TextUtils | Complete React Course in Hindi #8

Поділитися
Вставка
  • Опубліковано 17 гру 2024

КОМЕНТАРІ • 546

  • @CodeWithHarry
    @CodeWithHarry  3 роки тому +63

    For optimal learning, make sure to access, save and bookmark this playlist now: ua-cam.com/play/PLu0W_9lII9agx66oZnT6IyhcMIbUMNMdt.html

    • @user-me9vo2pf9r
      @user-me9vo2pf9r 3 роки тому

      Django channels videos

    • @ojestutorials8387
      @ojestutorials8387 3 роки тому

      Thanks

    • @farhanshaikh-ww7hl
      @farhanshaikh-ww7hl 3 роки тому +1

      Bhai please make a complete course on node js too 😍😍😍😍
      We will be so much happY harry Bhai
      How many peoples want this
      Hit the like like to know harry about this 💓💓💓💓💓💓💓👇❤❤❤

    • @prashantchouhan6394
      @prashantchouhan6394 3 роки тому +2

      buka buka boom boom

    • @samvibes8544
      @samvibes8544 3 роки тому

      harry bhai correction : precise time calculation k liye 0.01 use hota h ..
      And thanks for all your tutorials.

  • @user-me9vo2pf9r
    @user-me9vo2pf9r 3 роки тому +127

    3 videos in one day. Harry is on fire

  • @k31gamingtv
    @k31gamingtv 3 роки тому +78

    3 videos in a one day... this course is awesome thank you so much❤️

  • @KcClips
    @KcClips Рік тому +27

    0:00 epic start 🔥

  • @priyamvashi2187
    @priyamvashi2187 2 роки тому +52

    To avoid empty string, new lines, spaces in counting words and char use this
    {text.trim().length } characters
    {text.replace(/
    /g, " ").split(' ').filter(value => value != "").length} words

    • @ritwik99
      @ritwik99 2 роки тому +2

      Thanks I was looking for it

    • @anjalichauhan5169
      @anjalichauhan5169 2 роки тому +2

      read time increasing with empty cursor moving, how can I fix that

    • @LucknowiMohit
      @LucknowiMohit 2 роки тому +2

      @@anjalichauhan5169 {0.008 * text.trim().length}

    • @aash1r869
      @aash1r869 Рік тому

      @@anjalichauhan5169 {0.008 * text.replace(/
      /g, " ").split(' ').filter(value => value != "").length}

    • @webmynesubham8932
      @webmynesubham8932 Рік тому

      @@aash1r869 mera uper case and lower case honeke baad vanish ho ja rha h.. sentences.kya karu???cmmnt me plz!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @aunali2887
    @aunali2887 3 роки тому +5

    Harry Bhai you are Awesome.
    Watching Videos from Pakistan
    Seriously You are doing this great Job free of cost for us
    If you are here, so we don't have to go to any Institue
    🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
    ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️

  • @sainathpatil2820
    @sainathpatil2820 3 роки тому +9

    { text==="" ?0 :text.trim().split(" ").length} words, {text.length} characters
    removes extra trailing space

    • @soleiman3198
      @soleiman3198 2 роки тому +1

      this was what we want

    • @raghisasultan1680
      @raghisasultan1680 8 місяців тому +1

      Thankkkkk youuuuuuu so muchhhhhhhh

    • @sainathpatil2820
      @sainathpatil2820 7 місяців тому

      @@raghisasultan1680 Welcome #goodOldDays

    • @harishmadana7022
      @harishmadana7022 3 місяці тому

      {text.trim() === ""?0 : text.trim().split(" "). length) words
      Sorry but I found a small bug here. So adding my solution. But your logic was awesome. Thank you 😊.

  • @hindusanatanstatus3543
    @hindusanatanstatus3543 3 роки тому +38

    00:01 What A Start Bro,o I Can't Stop My Laughing (Boom Boom Guys )🤣 And...And...And That Was Unique Dialogue On 00:10

    • @JEE-pq2gl
      @JEE-pq2gl 3 роки тому

      🤣🤣🤣🤣

    • @risingup7359
      @risingup7359 Рік тому

      i repeated that 1 sec almost for 20-30 times 😂😂😂😂😂😂😂😂

  • @FutureeeBillionaireee
    @FutureeeBillionaireee Рік тому +6

    What i learned from this video also...
    1. Extra features to previous mini-project such as Text summary
    More importantly Time to read the text is quite important for me because i saw this feature in hashnode blogging side and i didn't know how it was done previously.. But now I am clear now!
    i.e done by calculating avg time to read a word i.e normally 300 wpm
    for one word it takes 60/300=0.2 minutes
    Time to read the whole text=(0.2*No of words ) Min
    :)

    • @dhyani-jii
      @dhyani-jii Рік тому +2

      Booka booka boom boom

    • @saqibalikhan3729
      @saqibalikhan3729 Рік тому

      300 words/60 seconds = 5words/second
      Or
      300 words/minute
      1 word/ (1/300)minute
      =1 word / 0.0033 minute

  • @santoshsonar9983
    @santoshsonar9983 3 роки тому +11

    Harry bhai is on 🔥🔥🔥 today..

  • @pramilavibhute5018
    @pramilavibhute5018 3 роки тому +1

    harry sir you re teaching is amazing..bahot hi acha sikhate ho app...jara bhi tuff or boaring nahi lagata...

  • @ieazambavakhan1245
    @ieazambavakhan1245 3 роки тому +3

    Thank you sir . I was really upset for reactjs to understand as I am student of Computer science but after watching your videos I learn a lot . After watching your tutorial I am sure I can perform best once again thank you

  • @BITTUKUMAR-xi3ve
    @BITTUKUMAR-xi3ve 3 роки тому +2

    Iss speed se to 2 week me hi complt ho jyga... React😎😎..... Thxxx Harry bhai ❤️❤️❤️

  • @pritamrajbhar7069
    @pritamrajbhar7069 Рік тому +3

    Really felt nervous while starting this course but glad till here its was amazing and felt really really happy by seeing my textutills app though it was done by seeing your video.Thank you Harrry bhaiya.

  • @harrybean3244
    @harrybean3244 3 роки тому +3

    Harry bhai i am inserting css in between, bcz its making it super beautiful!!!!, i already completed your HTML,CSS,JS course 😀😀

  • @ksingh0180
    @ksingh0180 3 роки тому +7

    11:53 For Remove space Counting in words 😁
    {text.split(/[^\s]+/).length} words, {text.length} characters

  • @arghamallick2126
    @arghamallick2126 Рік тому +2

    Day by day I'm loving react js. Everything for you ❤️

  • @tej_rasane_9
    @tej_rasane_9 8 місяців тому +2

    Video is awesome ❤ too much informative BUT I GUESS - THERE ARE 2 PROBLEMS. If we give many spaces simultaneously then also word count is increasing and also if we go to next line and type word and again go to next line and type one word then it's not counting. Please help with it. If anyone noticed this , like it or reply so that Harry might look into it 👍🏻👍🏻

  • @abhayjagtap4310
    @abhayjagtap4310 Рік тому +8

    You could've just added "Enter text here" as placeholder inside tag instead of removing it. BTW it's really nice course.

    • @fistya9999
      @fistya9999 Рік тому

      i hve tried it and it wont work cuz we need to pass the value (variable)so that the handleChange function would change it to current text as we type

    • @m.musaabkhan7914
      @m.musaabkhan7914 11 місяців тому

      he could have but for the purposes of teaching state functions he didnt

    • @abhayjagtap4310
      @abhayjagtap4310 11 місяців тому

      Oh I see, I guess you don't understand what I was trying to say.

    • @fistya9999
      @fistya9999 11 місяців тому

      @@abhayjagtap4310 ohh my bad

    • @fistya9999
      @fistya9999 11 місяців тому

      Ig ik what you had said but I wasn't able to explain that clearly

  • @pateljay5351
    @pateljay5351 3 роки тому +3

    At 11:33
    Word count = {text.split(" ").length - 1} try it Harry bhai ❤️

  • @seemapathak2381
    @seemapathak2381 2 роки тому +2

    Solution for the task at 11:54 for adding more logic to word counter:
    {text.split(" ")[text.split(" ").length - 1] == "" ? text.split(" ").length - 1 : text.split(" ").length} words and {text.length} characters

  • @shubhamsah8023
    @shubhamsah8023 3 роки тому

    seriously u r awesome.....itni bdiya tarike se props aur state samjh aaya hai .... aur ajki video mai jo logics bataye aapne :)

  • @inspired_enough_to_grow_up
    @inspired_enough_to_grow_up 2 роки тому +2

    Words count : {text.split(" ").filter(wrd => wrd).length}

    • @LucknowiMohit
      @LucknowiMohit 2 роки тому

      This will not work if we press enter and type again..

  • @shi-nee7966
    @shi-nee7966 3 роки тому +1

    For the algorithem. Altho i bought a course on udemy before this course started but i know harry bhai's the best. So im liking and commenting on every video for the algo.

  • @visheshgupta4990
    @visheshgupta4990 Рік тому +1

    I created my First React Application Thank you so much harry Bhai ❤

  • @AbhishekCodes
    @AbhishekCodes 3 роки тому +2

    Harry bhai is on fire, 3 videos in a day

    • @farhanshaikh-ww7hl
      @farhanshaikh-ww7hl 3 роки тому +1

      Bhai please make a complete course on node js too 😍😍😍😍
      We will be so much happY harry Bhai
      How many peoples want this
      Hit the like like to know harry about this 💓💓💓💓💓💓💓👇❤❤❤

  • @mibrahim2001
    @mibrahim2001 2 роки тому +13

    Here is a solution I came up with the words problem:
    So what we do is make an arrow function that will calculate the words, you can also do this in the jsx but to make the code more readable it is suggested to do it like this.
    {calculateWords()} words and {text.length} character
    {calculateWords() * 0.008} Minutes to read
    You have to place the function where you places rest of the functions (handleUpClick, handleLoClick etc )
    The function:
    const calculateWords = () => {
    let numOfWords = 0;
    let words = text.split(" ");
    let length = words.length;
    numOfWords =
    words[length - 1] === "" || words[length - 1] === " "
    ? length - 1
    : length;
    console.log(words);
    return numOfWords;
    };

    • @muhammadsamiislam
      @muhammadsamiislam 2 роки тому

      Thank you so much this code help me alot😇

    • @pulkitpareek
      @pulkitpareek Рік тому

      let words = text.trim().split(" ");
      replace works for empty spaces

  • @Raj1000_
    @Raj1000_ Рік тому +1

    12:00 {Text.trim().split(" ").length} words

  • @balvendrasingh8182
    @balvendrasingh8182 3 роки тому +1

    0:00 Harry Bhai is awesome 😎😎😎

  • @tanishqsharma3990
    @tanishqsharma3990 2 роки тому +9

    Booka booka boom boom 💥😂

  • @muskanchauhan-mussu
    @muskanchauhan-mussu 11 місяців тому +2

    for removing that 1 word from default value
    {text.split(" ").length} words and {text.length} characters
    remove the space btw the(" ") make it ("") 😊

  • @ayshikhalder9320
    @ayshikhalder9320 2 роки тому +4

    Thank you for such an amazing tutorial Harry bhai😇!
    Suggestion to count words properly.(Omitting empty string, omitting stop sign(.) )
    1)In JSX : {wordCount(text)} words and {text.length} characters.
    2) Creating a function wordCount:
    const wordCount = (value) => {
    return value.replace(/\./g, '')
    .split(' ')
    .filter(str => { return str !== '' })
    .length;
    };
    I hope this helps alot to those sceptical about accuracy!!

    • @varngupta1695
      @varngupta1695 2 роки тому +1

      thanx
      you missed the case when new line is used like
      hi
      there
      its 2 words but showing 1 word only using your code

    • @LucknowiMohit
      @LucknowiMohit 2 роки тому

      @@varngupta1695 replace(/\./g, '') use this>> replace(/
      /g, '')

    • @LucknowiMohit
      @LucknowiMohit 2 роки тому +2

      This code is working better than above as your code is not counting any word after pressing enter key..
      const wordCount = (text) => {
      return text.replace(/
      /g, " ")
      .split(' ')
      .filter(text => text !== "")
      .length
      };

    • @godshadow2k
      @godshadow2k 2 роки тому

      @@LucknowiMohit Yes, Now this seems better. Thanks for optimising the code

  • @AnilYadav-qn3ch
    @AnilYadav-qn3ch 2 роки тому +1

    Buka buka boom boom harry bhai🤣🤣🤣🤣😆

  • @geekylearner3596
    @geekylearner3596 3 роки тому +1

    Today is my Birthday harry bhai...and your react course is the best gift for me.

  • @mohituniyal7
    @mohituniyal7 3 роки тому +5

    I would comment in every video till you don't reply. I am really thankful to you. I didn't have cs in 12th but learned programming c and CPP from your videos and still learning. Moreover, I got a confidence boost. Once again thank you for your efforts.

  • @0xSatyajit
    @0xSatyajit Рік тому +3

    text.split(' ').filter((x) => x !== '').length
    can be used to calculate total words, it removes continuous space which is not a word still count a word.
    THis removes empty string from the array and return the length of it.

  • @Adityakumar-cr8hp
    @Adityakumar-cr8hp 3 роки тому +2

    bda jldi jldi videos aa rhe harry bhai 😂❤

  • @ashutoshranjan4644
    @ashutoshranjan4644 2 роки тому +1

    what a appalling start harry bhai😄

  • @Victor-ev3vu
    @Victor-ev3vu 3 роки тому +2

    *buka buka boom boom* Harry bahi 😉

  • @asvadsagheer8351
    @asvadsagheer8351 Рік тому +11

    Just wondering how many people gave up REACT. Number came down from 2.1M to 289k from 1st video to merely 8th video.

  • @asmittyagi6250
    @asmittyagi6250 Рік тому +1

    BOOKA BOOKA BOOOM harry bhai.

  • @kushagradubey6395
    @kushagradubey6395 3 роки тому +1

    This react Course is very very helpful
    Thank you Harry bhai

  • @adwaitbokade2890
    @adwaitbokade2890 3 роки тому +4

    You are really on 🔥 moj kardi
    Thank you for working really hard for us.
    This course is helpful.
    Agar app Galti se bhi 4 video dalta ho aj ,mein pagal ki tahara nachangua. 🥳

  • @PatadiyaManish
    @PatadiyaManish Рік тому

    Mast playlist Harry Bhai mast jakas ,bole to fadu ❤🎉

  • @AkshaySaxena-bl9zs
    @AkshaySaxena-bl9zs Рік тому

    Intro of this video is Exceptional Harry Bro

  • @leoguitargirl9600
    @leoguitargirl9600 2 роки тому +3

    Hats off to Harry

  • @meinhoonharsh
    @meinhoonharsh 3 роки тому

    9 ghante me 4 videos.. Harry Bhai is on another level.

  • @pushkarwaykole7043
    @pushkarwaykole7043 3 роки тому

    I felt so confident when I wrote to lower case myself before this video by following the previous video

  • @aymandin4912
    @aymandin4912 3 роки тому +1

    This react course is very helpful... You deserve trillion likes... hahahahahhahah

  • @ImranKhan-xi4jz
    @ImranKhan-xi4jz 2 роки тому

    love you harry Bhai its my starting to learn a react and I enjoying your toturial

  • @aritrasadhukhan5674
    @aritrasadhukhan5674 2 роки тому +10

    If you want to show 0 words in the start and character counting without spaces here's the code for you :
    {text === '' " ? 0 : text.split(" ").length} words and {text.replace(/ /g ,"").length} characters

  • @vishalgupta4516
    @vishalgupta4516 2 роки тому +10

    React Hooks must be called in a React function component or a custom React Hook function

  • @rahulshanisare60
    @rahulshanisare60 2 роки тому

    No. 1 series Harry Bhai

  • @shivampatel5280
    @shivampatel5280 3 роки тому +1

    this course is awesome thank you so much Harry Bhaii❤️

  • @iTzVIPER55
    @iTzVIPER55 2 роки тому

    Booka Booka BOOM BOOM! Harry bhau.....Best react course 🔥

  • @AbhishekCodes
    @AbhishekCodes 3 роки тому

    I am you subscriber since the start of your channel. Just appreciate your effort❤️❤️.

  • @ojestutorials8387
    @ojestutorials8387 3 роки тому

    These days you are making very awesome videos👌👌

  • @Zeegi
    @Zeegi 15 днів тому

    Very happy that I built a small word converter by myself

  • @Saurabh-fe2bg
    @Saurabh-fe2bg 3 роки тому

    brother please try to keep all the ads at the beginnin or at the end ...it is such a distraction to the wonderful content that you are sharing for free of cost....hats off dada.

  • @vrajeshbadgujar
    @vrajeshbadgujar 2 роки тому

    Buka buka boom boom .. already loving this course

  • @sailendrachettri8521
    @sailendrachettri8521 3 роки тому +2

    12:12 Quick fix
    {text.split(' ').length - 1} words

    • @sanketghule3648
      @sanketghule3648 3 роки тому +1

      Then what about time?

    • @sailendrachettri8521
      @sailendrachettri8521 3 роки тому

      @Prathamesh Thakur Thank You :)

    • @sailendrachettri8521
      @sailendrachettri8521 3 роки тому

      @@sanketghule3648 What time are you talking about?

    • @sanketghule3648
      @sanketghule3648 3 роки тому +1

      Are see when we add that 0.008 * text.split(""). length we get 0.008 time to read on main screen when there are no words in it

    • @sailendrachettri8521
      @sailendrachettri8521 3 роки тому

      @@sanketghule3648 {Math.floor((0.008 * text.split(' ').length)/3)} Min read
      hope this works

  • @sreeramvavilala3488
    @sreeramvavilala3488 3 роки тому +1

    Thanks soooooo much.... This React course is super helpful

  • @armaan4529
    @armaan4529 3 роки тому

    Harry on fire after a couple of months 3 videos in one day

  • @Fire_Ankush
    @Fire_Ankush 7 місяців тому

    To get accurate numbers of words, create a variable: let word = text.split(" ").length - 1. Use it like this =
    {word} Words, {text.length - word} Characters

  • @hadimomin4844
    @hadimomin4844 3 роки тому

    Just Enjoying this course....Thank You Sir....

  • @purvatayde5280
    @purvatayde5280 2 роки тому +3

    If above logic is not working for count of words and character u can use like this: {text.split(/[^\s]+/).length-1} words and {text.length} characters

  • @ashiphsayyad3074
    @ashiphsayyad3074 3 роки тому

    harrybhai ye clg se accha to aap sikhate ho....Thnaks HarryBhai

  • @HariomSingh-ei4fb
    @HariomSingh-ei4fb 2 роки тому +1

    This is very very helpful video sir jiii♥️

  • @michaelhenry4667
    @michaelhenry4667 3 роки тому +1

    I learned and did the following things from this videos:
    i. Added features like preview of the text,
    counting words and characters
    Counting the average read time and
    converting the texts to the lower case.

  • @technikalproblem6780
    @technikalproblem6780 5 місяців тому

    Buga buga boom boom sir! Thanks for making such a great video for us sir!

  • @Nayan_Dutta
    @Nayan_Dutta 6 місяців тому

    Best Lesson Harry. Your are Love..

  • @movieofficial3018
    @movieofficial3018 3 роки тому +5

    New playlist for Django ERP system

  • @sayondutta3530
    @sayondutta3530 3 роки тому +2

    {text.trim().split(" ").filter((e) => e !== "").length} - my logic for counting words

    • @LucknowiMohit
      @LucknowiMohit 2 роки тому

      Wrong logic as it is counting -1 words..

  • @sumeethaldar1056
    @sumeethaldar1056 2 роки тому +1

    To avoid empty string count as a word just simply write

    {text.split(" ").length - 1} words {text.length} characters
    {0.008 * text.split(" ").length - 0.008} Minutes read

    • @parvmangal8898
      @parvmangal8898 2 роки тому

      yes you are correct but the word count will only increase when you will press the space and that is not good user experience

    • @sumeethaldar1056
      @sumeethaldar1056 2 роки тому

      @@parvmangal8898 yes, you are correct.
      The above one is just for instant solution.

  • @MohammedRizwan-bh6ld
    @MohammedRizwan-bh6ld Рік тому

    This course is very very awesome harry bhai ☺☺☺

  • @Surya_0705
    @Surya_0705 3 роки тому +1

    Great Job Bro. You are on 🔥🔥🔥

  • @opurbo707
    @opurbo707 3 роки тому

    Aishe hi video dal te raho ❣️❣️❣️ take ❣️ from BD

  • @yourrockstar5553
    @yourrockstar5553 Рік тому +1

    Booka booka boom boom was unbeatable😂❤❤

  • @RishitaTomar-ku8ob
    @RishitaTomar-ku8ob 6 місяців тому

    Great series for beginners😊

  • @राजपूताना-ब5भ

    Booka booka boom boom Harry bhai 🙋‍♂️

  • @rickeyupadhyay6898
    @rickeyupadhyay6898 2 роки тому

    Great Video Harry Bhai The concepts got cleared!

  • @nikhilgarg9371
    @nikhilgarg9371 3 роки тому +1

    amazing work bro, really appreciable

  • @tanmaywaghole207
    @tanmaywaghole207 2 роки тому +1

    AMAZING BRO
    .

  • @shantanusingh6014
    @shantanusingh6014 2 роки тому

    shantanu singh
    1 second ago
    Use placeholder="enter text here" in to avoid removing text before typing

  • @paramgandhi5768
    @paramgandhi5768 2 роки тому +1

    in the split method, at the starting it shows one word even if you don't enter and after we add a space it just increases the number of words even if we do not write anything

    • @thanos3661
      @thanos3661 2 роки тому

      We can add more logic to it can't we?

  • @sausagemanearth5900
    @sausagemanearth5900 Рік тому

    best react course ever 🥰🥰🥰🥰🥰🥰😘😘

  • @mhcc296
    @mhcc296 Рік тому

    enjoying learning react from you

  • @razaproductionmaslak-e-ala9632
    @razaproductionmaslak-e-ala9632 2 роки тому

    bhut zabardast bro thankyou so much for giving us a such good information in a best way

  • @Amit.01
    @Amit.01 3 роки тому

    This course is Very helpful....Thankyou very much sir

  • @lillyput2275
    @lillyput2275 11 місяців тому

    East or west Haris bhai is the best🎉

  • @goluvishwakarma81036
    @goluvishwakarma81036 6 місяців тому

    sir i am your big fan and i hope Your good student

  • @gangalatharva
    @gangalatharva 3 роки тому

    The way you say "And I will see you next time......" 😌😌

  • @PuneethPrince
    @PuneethPrince 7 місяців тому

    Only few can complete this course 🎉🎉

  • @BaadShahDanger
    @BaadShahDanger Місяць тому +1

    Sir I have a query that " mere text box me words write nhi ho rhe h.." to mai kya kru ? Mujhe smjh nhi arha ... Please smjha diziye ! 😢

  • @shafii166
    @shafii166 Рік тому

    Daymnn khatarnakhhh💥💥💥

  • @indroneelgoswami5654
    @indroneelgoswami5654 6 місяців тому

    12:13 Better to use trim() before split()

  • @Zeegi
    @Zeegi 15 днів тому

    Yaay completed this video🎉

  • @VidyaSagar-mu2ui
    @VidyaSagar-mu2ui 10 місяців тому

    love your xplaination and njoying too:)

  • @rohitsingh8975
    @rohitsingh8975 3 роки тому

    bhai shaheb maza aa gya........ thanku bro

  • @umar-iq4ku
    @umar-iq4ku 11 місяців тому

    sir ma nay ap ke bootstrap ke video daki ha is very healtful 😍