I need to be able to change the text within the labels to a desired character. I can not use the password character, because the character is not consistant. It must also be able to ignore the spaces withing the label.
Dim rex As New System.Text.RegularExpressions.Regex("[^ ]")
lblMylabel.Text = rex.Replace(lblMylabel.Text, "x")
The expression "[^ ]" matches any non-blank character. Rex.Replace scans the given string and replaces any matching string with the second string so basically it says replace any non-blank character with an x.
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim OrigStr As String = "Test1 Test2 Test3"
Dim MaskStr As String = "xdfeotjdwps"
Dim OrigSplit() As String = OrigStr.Split()
For I = 0 To OrigSplit.Length - 1
OrigSplit(I) = Space(OrigSplit(I).Length).Replace(" ", MaskStr(I))
Label2.Text = Join(OrigSplit)
'Using Caesar Cipher
Label1.Text = CaesarCipher(OrigStr, "Test123")
Private Function CaesarCipher(Input As String, KeyStr As String) As String
Dim Key As Integer = 0
For Each c As Char In KeyStr
Key += Asc(c)
Dim Result As String = ""
If Key > 93 Then Math.DivRem(Key, 93, Key)
For Each c As Char In Input
If c <> " " Then
Dim offset As Integer = Key + Asc(c)
If offset > 125 Then offset = (offset - 125) + 32
Result += Chr(offset)
Result += c
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"