0

how can i check a string if it contains a val e.g a letter, and if it does i delete it from the string? my main issue is sending the value

$('.RemoveColumnNormalCol').live("click", function () {
            var st = $(this).attr('columnLetter'); //this can be any letter 
            $('.TotalHeading').each(function () {
                var test = $(this).val();
                var replace = test.replace(/"+ st +"/g, '');
                $(this).val(replace);
            });
 });   
3
  • test = test.replace(new RegExp(st, 'g'), ''); Commented Sep 1, 2016 at 8:50
  • So, if letter 'a' exists in the string, you want to remove 'a' from said string? Commented Sep 1, 2016 at 8:51
  • thanks for that, thats Pranav what i needed Commented Sep 1, 2016 at 9:13

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.