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]
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.
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")
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")
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.
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?
The file reads in parameters and two of the parameters used to be in Date Format YYYYMMDD but will now permanently be in format YYYY-MM-DD. This change, I believe, is stopping the import of the file from working. I would like to replace the new format YYYY-MM-DD back to YYYYMMDD in the code. If possible I'd also like to see some output so I know that the old format has been replaced with the new format. The code is below. I added the two rows with .replace code in green in expecting that to be enough but it is still not working.
Public Sub Main() Dim R1, O1, P1, C1, strDateFrom, strDateTo, strRunDate As String
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 |
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.
For each character of this string I want a new character out of the string and then remove the character from the list of characters that still maybe used for other characters. It may not get the same character, you could basically just call this encryption, but it's not what I am making. I don't want to waste my time doing this one hour while VB can do this for me in <1 second.
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.
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've been working with the substring command and after coding up all the things I needed it to do, I saw a post on here where the "For Each" statement was used basically to do the same thing.Lets say we just want to take a string apart one character at a time and add each character to a label. Which would be more efficient?I made a cheap example to show ...
Code: ABinary = "0110 1100 0001 1011" For x = 0 To Len(ABinary) - 1
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