Find and Replace Strings with JavaScript

Find and Replace Strings with JavaScript

10,940 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@kaiyong9885
@kaiyong9885 - 19.10.2022 11:21

what about text in textarea?

Ответить
@fate1722
@fate1722 - 14.10.2022 11:44

it doesn’t work for textarea if i edit what should i change?

Ответить
@zipponvr7043
@zipponvr7043 - 21.09.2022 09:34

why do you use while?
you can use regexp - its much simpler, works faster and isn't case sensitive

p.textContent.replace(new RegExp(find, 'gi'), replace)

Ответить
@investmentbros5650
@investmentbros5650 - 18.07.2022 01:15

Hello sir, can you do a video on multiple search and replace? I mean searching for more than one words

Ответить
@chesterxp508
@chesterxp508 - 25.09.2021 12:51

Another very cool tutorial!

Ответить
@singhvimlesh
@singhvimlesh - 27.01.2021 08:21

Can Anyone one help me out "Joan Smith" or "Matthew Joan Smith" how I will get only first and last word from these string.Answer must be : - for "Joan Smith" it will be (JS) and for "Matthew Joan Smith" it will be (MS).

Ответить
@steadfast4258
@steadfast4258 - 25.10.2020 07:15

sir for case sensitive what i will be use?

Ответить
@steadfast4258
@steadfast4258 - 23.10.2020 07:53

sir i want to replace text inside textarea field not in paragraph what is JavaScript code for it

Ответить
@jp-hz6br
@jp-hz6br - 28.05.2020 14:11

Hello Steve. I want to know how to do the find and replace trick but when finding multiple different items e.g. vowels. Is this possible using this method? I want to go through a string and replace all vowels. TIA!

Ответить
@rotrose7531
@rotrose7531 - 16.05.2020 09:24

To keep each tutorial at this high quality is not a easy thing, Thank you from my heart.

Ответить
@astrarai-thesobercoder
@astrarai-thesobercoder - 31.12.2019 00:38

Fire! Thanks so much for making this tutorial and thoroughly explaining your code!

Ответить
@sasimeshari
@sasimeshari - 08.10.2019 06:13

Spot on!!! Thanks a ton Steve.

Ответить
@kamranhughes4520
@kamranhughes4520 - 23.12.2018 04:54

Really appreciate the content Steve

Ответить
@Jeff-2112
@Jeff-2112 - 21.06.2018 01:21

You keep posting great JS tutorials on topics I didn’t know I wanted to learn. Keep them coming!

Ответить