Create A Function To Remove Dirty Words From User Input Text?
Sep 15, 2009
I am trying to create a function to remove dirty words from user input text and want to replace those dirty words with four ****. In my scenario , i have list of dirty words where i would iterate the input user text and want to replace. Say for example.,
Dim InputTxt As String = "hi bush how are you.... $hit and @ss"
Dim OutPut As String = " hi **** how are you... **** and ****";
Problem: It works fine to replace some word like " bush" however fails in the below function doesn't replace "$hit" and "@ss".
Note: I do not want to use string.Replace because it doesn't have word boundary in the sentence..
Public Function pReplaceWords(ByVal dirtyWord As String, ByVal inputText As String, ByVal options As RegexOptions) As String
Try
Trying to imitate a Messagebox - in that, a sub will not continue until the user "deals with" the pop up.
For example, in a sub, I want a Form to pop up, and ask a user a question, and give them 3 options. I want to make it so the user must click an option, and then the sub that called it can carry on it's way.
I've got 2 RTB one is for input of text and one is output.The output one needs to read the words from the input and display it alphabetically and with their line numbers.I have partly done it and it currently reads it but here is my problem When the words are outputted let say for example there are 2 words the same on the same line e.g the word 'you' appears twice on line one,at the moment its coming up like this
If my Category and Forum selection is incorrect I am sorry and feel free to move it. I'd like to have the users input in the message box that will show. For example: There is a textbox and the user puts in their name as Bob. Then the message box would be: What my main goal is, is being able to include the users input they type inside the textbox inside the message box.
I'm trying to create a program, that upon opening, will read an input file containing a delimited employee record. The record will contain the name of the employee, their salary and the number of years they have been employed.I'm looking to display only the name of the employees in sorted order(alphabetically) and then when the user of the program selects a particular employee, I want to display the salary and number of years for that employee.I would like the user to be able to edit the recors for the employee and I would also like to have a way for the user to be able to add/remove an employee record and update the input file before the program is closed.
i want to make a program in which the user can input a mathematical function so the program can then work with it. So the user would input something like x^4+x+2 and then an x and the program would calculate f(x). What i don't know is how to let the user input the function.
how to create a function that parses the input from a textinput.Text into an array of named reading, as string, and returns the number of arrays, or perhaps a negative number if there is an error in the input.
How to create a console application which would read input from user and assign the input to a variable? The problem is, I need to enter several words on one line separated with blank spaces like "ab cd efg" and then assign ab to one variable, cd to another variable and efg to another variable. Also the entered words can be any lenght.
how to create a form that allows a user to load an input file? I'm assuming a form like a windows explorer window will be too difficult, or not? If it is then I guess I could just put a textbox on the form and ask the user to input the directory with file name.
I'm trying to code a program that can download multiple files at once (on different threads of course).I have created a custom listview component that will allow me to add a progressbar directly to it.What my real question is, how can i take a url given by the user from an input box and create a new webclient to handle the download asynchronously and also report the progress without disturbing all of the other downloads in progress?
I'm making a custom control that needs to look like a Text Box but I can't Inherit Directly from text box since I need to add, Change and Override so many things that it would be more practical to just inherit Control and start new.
But now my question is: Is there an easy way to create the basic functionality of a Text Box like drawing the Text Box and handling input ?
I want to create one help file for my whole application. and once user press help button next to any input control then appropriate help topic from file should get display. how can i create this functionality in vb.net?
Alright. I have a project I need to complete by 11:00 am today. I need a program that will allow a user to input a phrase into a text box. Another text box to input a letter. Then I need the program to count how many times, the letter appears in the phrase. I have everything set up. I know how to count how many characters are in the string, but not how many designated letters there is.
I am using a text box to display a list of items in which I want to be for reading only. Is there any way that I can not allow user input into this text box? Right now I have the text changed set to show an error message, that works but the text entered before the message box appears, still shows.
What code would you use to email one text box's user input like a name. I have tried so hard for this but after 3 hours of stress I finally have decided to come here. This project is causing a lot of stress and I can't believe that these simple things are getting me
i use visual basic 6 i already try making a button to play sounds. by clicking the button and the sound will out. so that i want to know were could i start, when you input words in textbox the program will speak what you have type in the textbox. _
is there a way to accept user input and convert those inputs into command? e.g. i have a textbox that can "test" commands. when i type this into the textbox, it should run the command:
I have code to go through a document highlighting letter by letter:
Private Sub Timer1_Tick( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If Not RichTextBox1.SelectionStart < RichTextBox1.TextLength Then
How do I get numbers typed into a text box to be feed into my code and then the code to be ran?Below is the code that I want the information from a text box to be fed into. With the (0, 50) being the numbers.I will have a form set up like this, A button labeled Generate. 3 Text boxes total, 2 of them side by side with one being low and one high. For example The user will input 5 in the low box at 100 in the high box. Hitting generate the numbers will then be inserted into code and the result being shown in the 3rd text box.
Now what is the code that I'm looking for that will help me take information from TextBox1 and TextBox2 and insert into the (XXXX, XXXX) field in my buttons code?
I have lines in my text file like this: x y x Y x y x y x y x y x y x y x y x y x y x y x y x y x y x y x y x y x y x y
Lets say I have 20 lines like this. I want to change this lines according to user input. So user will input how many lines they want to change in terms of row and column. In my program Row=TextBox5.Text column=TextBox6.text User must enter initial value for x and y. Let say the initial value is x=1 y=1. Row=2 column=5..
Now my lines should look like this. 1 1 2 1 3 1 4 1 5 1 1 2 2 2 3 2 4 2 5 2 x y x y x y x y x y x y x y x y x y x y
Since I enter row=2 only two set of lines is change other lines remain unchange. But in my coding all the lines is changing like this: 1 1 2 1 3 1 4 1 5 1 1 2 2 2 3 2 4 2 5 2 1 3 2 3 3 3 4 3 5 3 1 4 2 4 3 4 4 4 5 5 which is wrong.
This is my code Dim lines() As String = IO.File.ReadAllLines("C:\wirematches.txt") Dim xValue As Decimal = Val(TextBox1.Text) Dim yValue As Decimal = Val(TextBox2.Text) Dim altValue As Decimal = 2.54 Dim lineTracker As Integer = 0 [Code] ..... This code working fine for changes the column. But i dont know where i should write the code for row.
I know there are work-arounds like using a Select Case, but in my situation, it would make things a lot easier... especially since I won't know exactly what will be entered. I can't force the user to use a combobox or anything like that either, because it is going to be unique code for every situation. If there is no way of doing this, I will figure something else out, but it will require a lot more work.
I'm familiar with Visual C# and the try/catch for that but I cannot seem to figure out how to do the same thing in VB. Basically I can't figure out how to get the try/catch to work with text boxes and input from the user and whatnot.I've tried setting the textbox.text property = "" but that has no use, I've been trying to find something on Google about it but I cannot seem to find a single thing about textbox try/catch statements. Is it possible to do it with text boxes?
I'm trying to create an app in Visual Basic that will allow a user to input an address, state, zip, some radio buttons and other data that will then add information into a json file.
Is there a simple way to save user input from MANY controls (textboxes, comboboxes, etc...) to a text file? When I say 'MANY', I am referring to at least 580 textboxes and several dozen comboboxes.
I may be able to accomplish this using the StreamWriter Class, but doing this individually would take quite a long time. I suppose I could also change all text boxes to richTextBoxes and save to .rtf. It seems like this would be even more time consuming.
Surely there is a simpler way to do this 'globally', perhaps with an added single line of code that points (and saves) to a preset or created text.txt file whenever text is added or changed in a textbox or combobox throughout the program.
I have a text box labled QTY, which feeds the QTY column on a datatable. the table then is ran through a function that takes the data and converts it to a string which my production machine can read. My problem is this, and its probably really simple (these problems usually are) how to i force the user to use a specific type of input on the txtbox so they would have to put the QTY in the format of 01 02 03 etc etc, i have it set to default to 00 but i want to force the user to haver to input 2 chars.
create admin form to register, Remove, Edit user accounts in the system connected to Microsoft SQL Server R2 2008 or access database ? any toturial videos or instructuions step by step ?
I am using VB.NET vb 2008 . I am trying to create text boxes dynammically and remove them here is the code i have written so far
Private Sub setTextBox() Dim num As Integer Dim pos As Integer
[Code]....
I am able to create the textboxes but only a few of them are removed. by using For Each ctrl In Panel1.Controls it doesn't retrieve all the controls and some ae duplicated as well.
I need to pull a random word from a text file in my resource folder (visual Studio 2010) and then have a user enter a letter to see if it is in the word. Yes, Hangman game. There is more, but right now I need to pull from that text file for a start. I know what I have is not even close to right under "Get Word Button", but I'm kind of confused about the process.
Public Class hangMan Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Dim word As New Random End Sub