Win a copy of Securing DevOps this week in the Security forum!
    Bookmark Topic Watch Topic
  • New Topic

replace String input with parenthesis  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi
i want to replace str with pipe symbol.

String str = "(test)";
str=str.replaceAll(str);
System.out.println("output => "+str);

solution:
output => (|)

but i want solution as

output =>
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Report post to moderator
You've already asked this question here. Carry the discussion on in that thread.
 
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!