# Problem vs2012 textbox char edit

Page 1 of 1

## 4 Replies - 450 Views - Last Post: 29 January 2013 - 09:29 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=310140&amp;s=56b7055cd2912c69ae88d3d3efa8f716&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 Rjjvv

Reputation: 0
• Posts: 12
• Joined: 29-January 13

# Problem vs2012 textbox char edit

Posted 29 January 2013 - 11:26 AM

Hi, what I want to do is to edit every char in a txtbox for ex: txtbox1.text = "Rudi"

Now it must take the text length and count each step, when the char (thats being checked atm = R) then textbox2.text = textbox2.text + "1R1"

then it must go to the next char and "u" must = "1u1" and should be added to textbox 2

So when T1 = "Rudi is my name" then T2 should be = "1R11u11d11i1 1i11s1 1m11y1 1n11a11m11e1"

The point of this is so that i can use a secret code..and set each letter to a value..ex R = 1614641

I DON"T want the bit like 10101101

Is This A Good Question/Topic? 0

## Replies To: Problem vs2012 textbox char edit

### #2 andrewsw

• But the opposite, you said.

Reputation: 5518
• Posts: 21,775
• Joined: 12-December 12

## Re: Problem vs2012 textbox char edit

Posted 29 January 2013 - 12:00 PM

NB THIS ISN'T VB6

```Dim strClip As String = "Rudi is my name"
strClip = Regex.Replace(strClip, "(\w)", "\1\$1\1")
Console.WriteLine(strClip)
```

Output:

Quote

'\1R\1\1u\1\1d\1\1i\1 \1i\1\1s\1 \1m\1\1y\1 \1n\1\1a\1\1m\1\1e\1

Oops
, I need to get rid of the slashes - give me a mo!
```strClip = Regex.Replace(strClip, "(\w)", "1\${1}1")
```

This post has been edited by andrewsw: 29 January 2013 - 12:05 PM

### #3 maj3091

• D.I.C Lover

Reputation: 324
• Posts: 1,924
• Joined: 26-March 09

## Re: Problem vs2012 textbox char edit

Posted 29 January 2013 - 12:01 PM

in VB6 you would use the LEN function for the length of the string.

You would use the MID\$ function to each individual character.

You would use a loop to work around the full string.

And there you go, Andrew beat me to it.

### #4 Rjjvv

Reputation: 0
• Posts: 12
• Joined: 29-January 13

## Re: Problem vs2012 textbox char edit

Posted 29 January 2013 - 09:22 PM

i have VS 2012 .. will go and try to see if code works

### #5 Rjjvv

Reputation: 0
• Posts: 12
• Joined: 29-January 13

## Re: Problem vs2012 textbox char edit

Posted 29 January 2013 - 09:29 PM

Nice, it works, but please help me to understand -> what is /w for? and can i give ex: R or u an individual value ex: R = 13 and u = 55