Skip to content

Commit

Permalink
remove text from a string in js completed
Browse files Browse the repository at this point in the history
  • Loading branch information
iamabhiCH committed Mar 28, 2024
1 parent aff33b1 commit 196ba2e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion str_remove_text.js
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
// WAP to remove text from a string in JavaScript
// WAP to remove text from a string in JavaScript

let str = "bskjbsvjhsvsknvbsdh xczvgsdhvbhsdvbjhsvhjshvsdhvz hjsvjhvhcvjhvvsdj";

function removeText(str){
console.log("Original String : "+str);

let str1 = str.replace("xczvgsdhvbhsdvbjhsvhjshvsdhvz", "");
return str1;
}

console.log("New String : "+removeText(str));

0 comments on commit 196ba2e

Please sign in to comment.