Results 1 to 15 of 15
  1. #1
    trevor206's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    324
    Reputation
    12
    Thanks
    107

    [help]Switching text to another letter

    ok so the title isn't very clear but here is what i need to do(i have searched im not sure if i searched right because i don't really know what to type but) i want it so if there is a / in a label it will turn the / into a -

    thanks in advance even if u can't help me.

  2. #2
    cosconub's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    in the programming section MPGH Cash: $90,000,000,000
    Posts
    372
    Reputation
    -4
    Thanks
    39
    My Mood
    Psychedelic
    i get it, i think, like how when u type a & in a label it underscores the text. Why the hell don't u just put a - in the label instead of /

    A man is but the product of his thoughts what he thinks, he becomes.
    ~Mohandas Gandhi


    A Genius is nothing with out an idea, An idea is always an idea even without a genius.
    ~ Immortal

  3. #3
    trevor206's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    324
    Reputation
    12
    Thanks
    107
    Quote Originally Posted by cosconub View Post
    i get it, i think, like how when u type a & in a label it underscores the text. Why the hell don't u just put a - in the label instead of /
    no like it changes all the a's in the label to b's.

  4. #4
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    label1.text.replace("/", "-") ????

  5. #5
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Code:
    Label1.Text = Label1.Text.Replace("/","-")
    If you need to replace multiple items, then use the following format:

    Code:
    Label1.Text = Label1.Text.Replace("A",a").Replace("B","b").Replace("C","c")
    ...

  6. #6
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Xscapism View Post
    Code:
    Label1.Text = Label1.Text.Replace("/","-")
    If you need to replace multiple items, then use the following format:

    Code:
    Label1.Text = Label1.Text.Replace("A",a").Replace("B","b").Replace("C","c")
    ...
    [php]
    For each m as match in Regex.Matches(Label1.Text, "[ABC]")
    Label1.Text = Label1.Text.Replace(m.value, m.value.tolower)
    next
    [/php]


    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  7. #7
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Quote Originally Posted by Jason View Post


    [php]
    For each m as match in Regex.Matches(Label1.Text, "[ABC]")
    Label1.Text = Label1.Text.Replace(m.value, m.value.tolower)
    next
    [/php]

    Mate, overkill

  8. #8
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by freedompeace View Post
    Mate, overkill
    No shit lol, I just like Regex and giving Hassan shit 'cos he forgot a lot of it

    Although I do like this function, very VERY occasionally comes in handy :P

    [php]
    Private Function ReplaceText(ByVal original As String, ByVal replaceWhat() As String, ByVal replaceWith() As String, ByVal ignorecase As Boolean) As String
    If replaceWha*****unt = replaceWith.Count Then
    For i As Integer = 0 To replaceWha*****unt - 1
    If ignorecase Then
    original = original.ToLower.Replace(replaceWhat(i).ToLower, replaceWith(i).ToLower)
    Else
    original = original.Replace(replaceWhat(i), replaceWith(i))
    End If
    Next
    Else
    MsgBox("arrays not the same size")
    End If
    Return original
    End Function

    '...
    textBox1.Text = ReplaceText(TextBox1.Text, New String() {"A", "B", "C", "D"}, New String() {"x", "y", "z", "w"}, false)
    [/php]

    (Yes i'm procrastinating from study)

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  9. #9
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Quote Originally Posted by Jason View Post


    No shit lol, I just like Regex and giving Hassan shit 'cos he forgot a lot of it

    Although I do like this function, very VERY occasionally comes in handy :P

    [php]
    Private Function ReplaceText(ByVal original As String, ByVal replaceWhat() As String, ByVal replaceWith() As String, ByVal ignorecase As Boolean) As String
    If replaceWha*****unt = replaceWith.Count Then
    For i As Integer = 0 To replaceWha*****unt - 1
    If ignorecase Then
    original = original.ToLower.Replace(replaceWhat(i).ToLower, replaceWith(i).ToLower)
    Else
    original = original.Replace(replaceWhat(i), replaceWith(i))
    End If
    Next
    Else
    MsgBox("arrays not the same size")
    End If
    Return original
    End Function

    '...
    textBox1.Text = ReplaceText(TextBox1.Text, New String() {"A", "B", "C", "D"}, New String() {"x", "y", "z", "w"}, false)
    [/php]

    (Yes i'm procrastinating from study)
    I've never seen this before "ByVal replaceWhat() As String"... Why () after the variable name? ._.

    Also err, RegEx comes in handy when filtering emails, BBCode creation and filtering user input like birthdays.

  10. #10
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by freedompeace View Post
    I've never seen this before "ByVal replaceWhat() As String"... Why () after the variable name? ._.

    Also err, RegEx comes in handy when filtering emails, BBCode creation and filtering user input like birthdays.
    () denotes an array, so the function requires you to pass 2 string arrays into it. (thought you would know something basic like this)

    i.e
    things to replace{"hello", "this", "is", "a", "test""}
    replace with (same order as first array) {"i", "höpe", "this", "works", "good"}

    hello will be replaced with "i"
    "this" will be replaced with "hope"
    "is" will be repaced with "This"
    ...etc

    Easy way of replacing multiple things.

    As a sidenote, regex is useful for a lot more than filtering emails etc...there are many many cases where it can be extremely useful.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  11. #11
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Quote Originally Posted by Jason View Post

    () denotes an array, so the function requires you to pass 2 string arrays into it. (thought you would know something basic like this)

    i.e
    things to replace{"hello", "this", "is", "a", "test""}
    replace with (same order as first array) {"i", "höpe", "this", "works", "good"}

    hello will be replaced with "i"
    "this" will be replaced with "hope"
    "is" will be repaced with "This"
    ...etc

    Easy way of replacing multiple things.

    As a sidenote, regex is useful for a lot more than filtering emails etc...there are many many cases where it can be extremely useful.
    Oh woops --"

    Looked like a function to me ~.~

    Even in Visual Basic, I use [] to denote an array. It so much easier than distinguishing between a function with a paramter or an array when you're using a complex, long line of code.

  12. #12
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Jason View Post


    [php]
    For each m as match in Regex.Matches(Label1.Text, "[ABC]")
    Label1.Text = Label1.Text.Replace(m.value, m.value.tolower)
    next
    [/php]
    Don't mess with me kid.

    @freedompeace: Lol what ? You really used '[]' in Visual Basic to donate an array or you trolling me ? LOL

  13. #13
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Xscapism View Post


    Don't mess with me kid.

    @freedompeace: Lol what ? You really used '[]' in Visual Basic to donate an array or you trolling me ? LOL
    I'm better than you at VB, remember? .

    @freedom, () does't really look like a function at all, I have no problems reading a long line of code where () is used to denote an array, but maybe that's just me.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  14. #14
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Jason View Post


    I'm better than you at VB, remember? .

    @freedom, () does't really look like a function at all, I have no problems reading a long line of code where () is used to denote an array, but maybe that's just me.
    Serious trolling was serious !

    And you remember what Brinuz said about freedom ! /

  15. The Following User Says Thank You to Hassan For This Useful Post:

    'Bruno (10-25-2010)

  16. #15
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Xscapism View Post


    Serious trolling was serious !

    And you remember what Brinuz said about freedom ! /
    I do /

    Also, serious screencapping was serious !
    And done with your own application /

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

Similar Threads

  1. [Help]Save Text to Desktop[Solved]
    By ppl2pass in forum Visual Basic Programming
    Replies: 8
    Last Post: 03-16-2010, 08:45 AM
  2. [Help]Print Text Box [Solved]
    By zmansquared in forum Visual Basic Programming
    Replies: 7
    Last Post: 03-10-2010, 06:56 PM
  3. [Help]Basic Text Box[Solved]
    By FlashDrive in forum Visual Basic Programming
    Replies: 3
    Last Post: 03-06-2010, 10:54 PM
  4. [HELP]switch weps
    By kklolirocku in forum Combat Arms Mods & Rez Modding
    Replies: 6
    Last Post: 12-28-2009, 12:41 PM
  5. help with text on sig!
    By mexicano007 in forum Art & Graphic Design
    Replies: 11
    Last Post: 06-28-2009, 03:01 PM