Jump to content

How to filter output using the Java printf statement


Recommended Posts

Is it possible to use a formatting (escape) sequence in the Java printf statement to remove specific characters from the string argument? For example, if I have a string like, "[0, 1]", is there a formatting string I can use to remove the left and right bracket characters ([])? Is there a "regular expression" for the Java printf statement that will filter out those characters?

Link to post
Share on other sites
  • 3 weeks later...
On 11/17/2019 at 4:42 AM, babyboomer said:

Is it possible to use a formatting (escape) sequence in the Java printf statement to remove specific characters from the string argument? For example, if I have a string like, "[0, 1]", is there a formatting string I can use to remove the left and right bracket characters ([])? Is there a "regular expression" for the Java printf statement that will filter out those characters?

Yes. It will helpful.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...