-
Dec 4th, 2021, 12:45 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Replace text inside brackets
Hi,
stupid question, but how can I replace?
Code:
(THIS-IS-A-SENTENCE),but it is for 147th place in content.
with
Code:
(NO-SENTENCE),but it is for 147th place in content.
incl.brackets, not only text within brckts.
Please dont forget to add good reputation if my advices were useful for you.
How? Under this post there is "RATE THIS POST" button. Click on it.
-
Dec 4th, 2021, 01:28 PM
#2
Re: Replace text inside brackets
Do you want to replace or remove what is inside of the PARENTHESES.
Is there only one instance per line? Could there be a parenthesis for any other reason.
-
Dec 4th, 2021, 02:06 PM
#3
Re: Replace text inside brackets
Regex replace would probably work, but we need to know if that’s the only set of brackets in your text
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Dec 4th, 2021, 02:22 PM
#4
Thread Starter
Hyperactive Member
Re: Replace text inside brackets
Originally Posted by .paul.
Regex replace would probably work, but we need to know if that’s the only set of brackets in your text
Yes, only one set of brackets.
Please dont forget to add good reputation if my advices were useful for you.
How? Under this post there is "RATE THIS POST" button. Click on it.
-
Dec 4th, 2021, 02:26 PM
#5
Re: Replace text inside brackets
Code:
MsgBox(System.Text.RegularExpressions.Regex.Replace("(THIS-IS-A-SENTENCE),but it is for 147th place in content.", "\(.+\)", "(NO-SENTENCE)"))
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Dec 4th, 2021, 03:01 PM
#6
Thread Starter
Hyperactive Member
Re: Replace text inside brackets
Thanks paul, this works!
Code:
TextBox4.Text = (System.Text.RegularExpressions.Regex.Replace(TextBox4.Text, "\(.+\)", TextBox_5.Text))
Please dont forget to add good reputation if my advices were useful for you.
How? Under this post there is "RATE THIS POST" button. Click on it.
-
Dec 4th, 2021, 03:19 PM
#7
Re: [RESOLVED] Replace text inside brackets
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|