i have a string "David John Roplay" i need to replace first occourance of the space " " into double space " "i have used String.Replace() but it is relplacing all the spaces.
Im working on a program for my work and it is starting to get pretty in depth. Is there any way to replace just one occurence of a string. I tried this:
have a list of 84000 words , and have some articles in these articles i want to replace first occurrence of each word i have in listbox e.g [code]but it used to replace the whole mytext i want to replace words in mytext and also it hang the system and very very slow and replace all occurrences.
I am working on a sub that essentially needs to open a text file, and replace all instances of a certain character with a unicode character. I'm trying to do this by reading the original text file byte by byte, converting it to a character, and then either adding that character to a memory stream or writing the unicode character to the memory stream. Then I'm saving the memory stream to the original file.
I am writing a hangman type game and I am displaying the word to the user in a label as all *'s, but I cannot figure out how to have just one of the *'s changed in the label to the correct letter when the user inputs the correct letter into the text box and clicks the check letter button.Everything else in the program works perfectly, except for this part.[code]When I use the .Replace it changes all of the *'s to the correct selected letter.
the coding is to 'Get input string and put its character into List, and replace the character with other.'but having problem putting each character into List and also replacing it,[code]
This code is working fine, but now I want to replace two times and I want to use the replace function twice. Something like this, but it is not working . Can anyone tell me how to use Replace function multiple times?
I'm trying to import an xml file into vb.net XmlDocument but am getting the error:'.', hexadecimal value 0x00, is an invalid character. Line 94, position 1.I'm wondering if there is a way to replace the hex character 0x00The following are lines 92,93,94 the file ends on line 94
92 | </request> 93 |</rpc> <!-- XML Finishes here --> 94 |
So I have software to replace string with string, it's cool but I need code which would replace any given character (for example a) with all strings from textbox.
What i am trying to do is take a character (which is going to be into a variable by user input) and search a string for this character, and save the positions of all character found and then change the same position of these characters in another string for the character that the user inputs. In other words, like a guess a word game. User tryes a guess, i search the string for that letter or number, if it's there replace it on the text box of the GUi, if not save it in another variable as a character that has been tried already, possibly an array.
Lets say I have a label with the text "_ _ _ _ _ ", some underscores. Now what if I want the program to locate the 3rd underscore and replace with something else. Is this possible? I was guessing by getting the character's position first and somehow there is a function that replaces characters by their position.
I have the problem that the DataGridView has obviously a shortcut key for SHIFT + SPACE which seems to select the row.What I would like to have is that pressing SHIFT + SPACE simply adds a space character to the current cursor position within the current cell (like for example in notepad)
I have 10 lines of array that are first name space last name space zip code. All the zip codes start with different numbers. Is there a way to replace the #1 in the indexof below so that it searches for any number character instead?
'open file inFile = IO.File.OpenText("Names.txt") 'process the loop instruct until end of file intSubscript = 0
How can I replace character/word in text (loaded to richboxtext) but only for those which are not on the "block" list ? Dim str As String = RichTextBox2.Text RichTextBox3.Text = str.Replace("1"c, "A"c)
But I want add list of words which should be excluded. I thought that I can do something like : Dim str As String = RichTextBox2.Text If Regex.IsMatch(RichTextBox2.Text, "shows") Then Else RichTextBox3.Text = str.Replace("%"c, " "c) End If RichTextBox3.Text = str.Replace("1"c, "A"c) Dim str2 As String = RichTextBox3.Text RichTextBox3.Text = str2.Replace("2"c, "B"c)
But it's not working as it will just skip replace of % for whole text and I want just just exclude particular word from list from being replaced...
I'm trying to replace one character at a time in order to store its index, therefore if the replace is used all characters are changed and I cannot keep the index of all characters.
I'm trying to replace all the carriage return characters in a string obtained from a multi line text box in a Windows Form with the string ", <BR>" so that when I use the string in some HTML it displays correctly.
Function Blah(ByVal strInput As String) As String Dim rexCR As Object rexCR = CreateObject("VBScript.RegExp")
earlier with my program question and found out that """" is how you make " become another variable in the function:Robert = Replace(Robert.ToLower, """", "A")So now I am also trying to work with other keys like the semi-colon. I put it in the function like this:Robert = Replace(Robert.ToLower, "char(59)", "B")I also tried to insert ; in place of char(59) with in front of it as an escape key, none of this worked. It still just gives me a ; when I type
I'm trying to replace all the carriage return characters in a string obtained from a multi line text box in a Windows Form with the string ", <BR>" so that when I use the string in some HTML it displays correctly.
Function Blah(ByVal strInput As String) As String Dim rexCR As Object rexCR = CreateObject("VBScript.RegExp")