[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

how would i replace a word or part of a word in a label containing a few paragraphs or text

I would like to be able to replace word, or parts of words, submitted in a text box before uploading.  How it works now, is they type in the information and hit submit, in a label below the TextBox, it shows what they typed, and how it will look. Then a button become visible for them to continue.  What i would like to do is parse through what they typed and replace or delete unexceptionable words or parts of word.  I know this can be done, but don't know how.

Thanks.

BTW  It's in  c#
0
bmanmike39
Asked:
bmanmike39
2 Solutions
 
nickinthoozCommented:
use the .replace to replace the text
string myString = TextBox1.Text.ToString();  
        string replaceString = myString.Replace("oldtext","newtext"); 

Open in new window

0
 
Michael FowlerSolutions ConsultantCommented:
To remove or replace words from the string you will need to determine what needs to be replaced and this could prove problematic as you would need access to a dictionary to identify non-word strings and a listing of all invalid/reserved words

Michael
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now