Looks like just the spot for a bit of recursion. create yourself a subroutine that creates the upper and lower case version of an ordinal position and then have it call itself until you reach the end of the string.
Have you thought about the string case as a representation of binary?
You can calculate the number of iterations as the length of the string squared.
So, if there are 4 characters in the name, you would need 16 binary numbers:
0000 to 1111: where 0 represents one case and 1 represents the other.
As the bits get set, they can be used to toggle the case of the characters in the string.
Function StringToBinaryCase(ByVal strName As String, ByVal strBinary As String) As String
Dim sb As New StringBuilder
For i As Integer = 0 To strName.Length - 1
If (strBinary(i).ToString().Equals("1")) Then
Dim strName As String = "John"
Dim intOrigLen As Integer = strName.Length
For i As Integer = 0 To (intOrigLen * intOrigLen) - 1
StringToBinaryCase(strName, Convert.ToString(i, 2).PadLeft(intOrigLen, "0")))
Edited 4 Years Ago by thines01: added output image
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
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 = ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.