Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7774621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:25:28+00:00 2026-06-01T17:25:28+00:00

$arg=TEST #### Requested, NOT AVAILABLE psy #; I have a string above where the

  • 0
$arg=TEST #### Requested, NOT AVAILABLE psy #;

I have a string above where the # is dynamically generated.
I have to use a function in tcl to do a string replacement.
Basically I need to remove the comma(,) form the above expression and display it as

TEST #### Requested NOT AVAILABLE psy #

Here’s what I did, but it is not working.

regsub -all {"Requested,"} $arg {"Requested"} arg

This is where i referenced the function from:
http://www.tcl.tk/man/tcl8.5/TclCmd/regsub.htm

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:25:29+00:00Added an answer on June 1, 2026 at 5:25 pm

    The problem is your quoting. You are actually checking for the string "Requested," (including the quotes), but that isn’t what you want. Try either getting rid of the squiggly-brackets (}) or double quotes ("):

    set arg "TEST #### Requested, NOT AVAILABLE psy #;"
    regsub -all "Requested," $arg "Requested" arg
    

    If all you need to get rid of is the comma, you can search/replace that (just replace it with the empty string ""):

    regsub -all "," $arg "" arg
    

    or

    regsub -all {,} $arg {} arg
    

    As a commenter had mentioned, the latter may be better in the general case, since regular expressions often contain many backslashes (/) and the {} brackets don’t require massive amounts of distracting extra backslash escapes the same way that "" quotes do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code public class TEST { public static void main(String arg[]){ try
here's the call inside a [Test] _youTubeService.AssertWasCalled(d => d.GetFeedByAuthorWithRequest(Mark, Arg<YouTubeRequest>.Is.Anything)); here's the function on
I have the following test function to copy and concatenate a variable number of
Say I have the following methods: def methodA(arg, **kwargs): pass def methodB(arg, *args, **kwargs):
What is the rationale of not providing no-arg constructors in Wrapper Classes? I know
Here's the code snippet: public static void main (String[]arg) { char ca = 'a'
Assume the following function prototype: void *function(int arg) . Is that a pointer to
I am trying to test the use-case of a customer having a proxy with
I have a javascript function for shrinking images but I dont want the shrinking
I have the following sample test code public Stage Test(Stage Stage) { var StartStage

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.