Results 1 to 4 of 4

Thread: help with converter

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Location
    Cali,USA
    Posts
    9

    help with converter

    well im basicly a noob too visual basic .NET and i need some help with this i wanted to try to make a text converter
    this is what i have so far

    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 
    
       textBox2.Text = ConvertMe(textBox1.Text) 
    
    End Sub 
    
    Function ConvertMe(ByVal textData as String) as String 
    
       Dim tempChar as String ' holds a character to compare to 
       Dim textConversion as String 'holds the converted text 
       textConversion = "" ' initialize empty string VB may already do this i don't know. 
    
       tempChar = textConversion.SubString(0,1) ' get the first char in the string 
        
       if tempChar = "a" Then 
          textConversion+= "4" 
       End If 
        
        return textConversion 
    End Function
    but i cant seem to get it to work, ne help would be very nice

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Convert a string to what type ?

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Is this what you want ?

    VB Code:
    1. Private Function Changeto(ByVal str As String) As String
    2.         Dim ChangedStr As String = Nothing
    3.         ChangedStr = Replace(str, "e", "3", 1, 3, CompareMethod.Text)
    4.         MsgBox(ChangedStr)
    5.     End Function
    6.  
    7. 'Usage
    8. Changeto("phear")

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Location
    Cali,USA
    Posts
    9
    yea ill try to get that to work

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width