From 57408bfb8d50c6d7a00b98822f7628d57dfe0516 Mon Sep 17 00:00:00 2001 From: Swastik3025 Date: Sun, 30 Oct 2022 16:23:52 +0530 Subject: [PATCH] Added remove extra space feature --- src/components/TextForm.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/TextForm.js b/src/components/TextForm.js index 500e932..51a3b9e 100644 --- a/src/components/TextForm.js +++ b/src/components/TextForm.js @@ -32,6 +32,10 @@ export default function TextForm(props) { setText(newText); props.showAlert("Changed to Titlecase","success"); } + const handleRemove=()=>{ + let newText=text.split(/[ ]+/) + setText(newText.join(" ")); + } const handleClearClick= ()=> { @@ -118,6 +122,7 @@ export default function TextForm(props) { +