如何从jquery中的大括号内删除字符? [英] How to remove character from inside a braces in jquery ?

查看:150
本文介绍了如何从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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆