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

preview_player
Показать описание
In this react course, we will see how to learn react using projects.
This is going to be a project-based course full of real-world react projects. In this video, we will add some more logic to our existing textutils react app.

Best Hindi Videos For Learning Programming:

►C Language Complete Course In Hindi -

►JavaScript Complete Course In Hindi -

►Django Complete Course In Hindi -

Follow Me On Social Media
Comment "#HarryBhai" if you read this 😉😉
Комментарии
Автор

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

kgamingtv
Автор

To avoid empty string, new lines, spaces in counting words and char use this

<p>{text.trim().length } characters</p>
<p>{text.replace(/\n/g, " ").split(' ').filter(value => value != "").length} words</p>

priyamvashi
Автор

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
🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥



❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️

aunali
Автор

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

sainathpatil
Автор

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

hindusanatanstatus
Автор

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

:)

FutureeeBillionaireee
Автор

11:53 For Remove space Counting in words 😁
words, {text.length} characters</p>

ksingh
Автор

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.

pritamrajbhar
Автор

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

ieazambavakhan
Автор

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

harrybean
Автор

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

BITTUKUMAR-xive
Автор

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

arghamallick
Автор

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

visheshgupta
Автор

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

seemapathak
Автор

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

abhayjagtap
Автор

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.

<p> {calculateWords()} words and {text.length} character </p>
<p> {calculateWords() * 0.008} Minutes to read </p>

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;
};

mibrahim
Автор

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

pramilavibhute
Автор

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

shubhamsah
Автор

Thank you for such an amazing tutorial Harry bhai😇!
Suggestion to count words properly.(Omitting empty string, omitting stop sign(.) )

1)In JSX : <p>{wordCount(text)} words and {text.length} characters.</p>
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!!

ayshikhalder
Автор

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 👍🏻👍🏻

tej_rasane_