如何从jquery中的大括号内删除字符? [英] How to remove character from inside a braces in jquery ?
问题描述
嗨团队,
我有方括号内的数据。我需要删除括号中的字符。
ex :( ad){3-5},(AF){5-8},(0-6 ){8-9},[#$%^&,+ /]
如上例所示我需要删除方括号内的逗号(,)。
i需要输出格式如下。
(ad){3-5},(AF) {5-8},(0-6){8-9},[#$%^& + /]
如何使用jquery或javascript ..?
问候
Nanda Kishore.CH
我尝试过:
i尝试了这个.replace(/,/ g,'');
但它删除了字符串中的所有逗号。
喜欢这个:
(ad){3-5}(AF){5-8}(0-6){8-9} [#$%^& + /]
这里我只需要删除方括号内的逗号。
像这样:
(ad){3-5},(AF){5-8},(0-6){8-9},[#$%^& + /]
Hi team,
i have data inside a square brackets. i need to remove character in side a braces.
ex: (a-d){3-5},(A-F){5-8},(0-6){8-9},[#$%^&,+/]
as above example i need to remove comma(,) inside a square brackets.
i need output as below format.
(a-d){3-5},(A-F){5-8},(0-6){8-9},[#$%^&+/]
how to solve this using jquery or javascript.. ?
Regards
Nanda Kishore.CH
What I have tried:
i tried this .replace(/,/g, '');
but it removes all commas in a string.
like this:
(a-d){3-5}(A-F){5-8}(0-6){8-9}[#$%^&+/]
here i need to remove only inside square brackets comma.
like this:
(a-d){3-5},(A-F){5-8},(0-6){8-9},[#$%^&+/]
推荐答案
%^&,+ /]
如上例所示我需要删除方括号内的逗号(,)。
i需要输出如下格式。
(ad){3-5},(AF){5-8},(0-6){8-9},[ #
%^&,+/]
as above example i need to remove comma(,) inside a square brackets.
i need output as below format.
(a-d){3-5},(A-F){5-8},(0-6){8-9},[#
%^& + /]
如何使用jquery或javascript解决这个问题..?
问候
Nanda Kishore.CH < br $> b $ b
我尝试了什么:
i试过这个.replace(/, / g,'');
但它会删除字符串中的所有逗号。
是这样的:
(ad){3-5}(AF){5-8}(0-6){8-9} [#
%^&+/]
how to solve this using jquery or javascript.. ?
Regards
Nanda Kishore.CH
What I have tried:
i tried this .replace(/,/g, '');
but it removes all commas in a string.
like this:
(a-d){3-5}(A-F){5-8}(0-6){8-9}[#
%^& + /]
这里我只需要删除方括号内的逗号。
喜欢这个:
(ad){3-5},(AF){5-8},(0-6){8-9},[#
%^&+/]
here i need to remove only inside square brackets comma.
like this:
(a-d){3-5},(A-F){5-8},(0-6){8-9},[#
这篇关于如何从jquery中的大括号内删除字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!