We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b41ee25 commit 6e70b7cCopy full SHA for 6e70b7c
project-1/project-app/src/components/TextForm.js
@@ -77,7 +77,7 @@ export default function TextForm(props) {
77
</div>
78
<div className="container my-4" style={{color: props.mode ==='dark' ? 'white' : 'black'}}>
79
<h2>your text summary</h2>
80
- <p>{text.split(" ").length} words and {text.length} characters </p>
+ <p>{text.split(/[^\s]+/).length - 1} words and {text.replace(/ /g,"").length} characters </p>
81
<p>{0.008 * text.split(" ").length} Minutes read</p>
82
<h2>Preview</h2>
83
<p>{text.length > 0 ? text: "Enter something in the above textBox"}</p>
@@ -88,6 +88,7 @@ export default function TextForm(props) {
88
89
90
91
+// text.split(" ").length
92
93
// let newText = () =>{
94
// let newString = "";
0 commit comments