Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Iron Speed
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old April 25th, 2008, 07:06 AM
Phoenix_riser Phoenix_riser is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 223 Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level)Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level)Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level)Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level)Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 2 h 7 m 21 sec
Reputation Power: 14
Remove tab from string

My code is a validation program and it removes all not valid characters by only keeping the valid ones. However tabs still stay! I've tried stripping them with Trim and replace functions but neither work. Help!

Code:
'tried to remove tab section
strTest1Orig1 = strTest1Orig
vbTab1 = vbTab & vbTab
strTest1Orig = Replace(strTest1Orig1, vbTab1, "")


ALL CODE excluding importing value

Code:
Public Sub PrcFormat_Tidy(strTest1, type1)


type1 = LCase(type1)
                'removes invalid characters and makes all characters CAPS as per format requested
                
                Dim strTest1Orig
                
                strTest1Orig = strTest1
                
                '###########
                
      If type1 = "" Then ' check default
                strValidChar = "abcdefghijklmnopqrstuvwxyz0123456789@ -'_"
     Else
     If type1 = "letter" Then
                strValidChar = "abcdefghijklmnopqrstuvwxyz"
     Else
     If type1 = "number" Then ' check default
                strValidChar = "0123456789"
     End If
     End If
     End If
     
    If Len(strValidChar) > 0 Then
              'if there are valid characters
            
              Counter2 = Len(strValidChar)
              
        For Counter1 = 1 To Counter2
              
               vRemove = Mid(strValidChar, Counter1, 1)
               strTest1 = Replace(strTest1, vRemove, "")
              
        Next Counter1
          
    Else
    End If

'#################

If Len(strTest1) > 0 Then
    'need to remove a character
    
    vCounter4 = Len(strTest1)
  
    For Counter3 = 1 To Counter4
            
            vRemove = Mid(strTest1, Counter3, 1)
            'find the first character via the loop then loop and find second these characters
            'come from the remaining characters after removing validate characters
            strTest1Orig = Replace(strTest1Orig, strTest1, "")
            
            
    Next Counter3
Else
End If
strTest1Orig1 = strTest1Orig
vbTab1 = vbTab & vbTab
strTest1Orig = Replace(strTest1Orig1, vbTab1, "")
    
strTest1Orig = UCase(strTest1Orig)

If Len(strTest1Orig) > 0 Then

        strTest1 = strTest1Orig

Else

        strTest1 = " "

End If

type1 = ""

End Sub

Reply With Quote
  #2  
Old April 30th, 2008, 10:38 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,831 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 15 h 16 m 28 sec
Reputation Power: 57
I'm confused. Do you want to remove *all* tabs or only where there are two tabs together? Does this not work:
Code:
strTest1Orig = Replace(strTest1Orig1, vbTab, "")
__________________
selwonk

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Remove tab from string


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway