Useful JavaScript/VBScript String Functions (Server side)
page 1 of 2
Published: 09 Oct 2003
Unedited - Community Contributed
Common string function in VBScript and JavaScript that will divide a text string into equal portions, left and right.
by Taewook Kang
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 18053/ 28

VBScript Version

Following are the common string functions (both in VBScript and JavaScript) which can be used in your application.


'chop function
'Author: Taewook Kang ( )

'chop function takes four arguments.
'if you do...
'chop( "Hello Kang! Nice to meet you!","",leftPortion,rightPortion )
'as a result, leftPortion will contain "Hello Kang! Nice" and rightPortion will
contain " to meet you!" 'I find this function useful in making newsletter application
and I use this often.

function chop( byval s,byval item,byref p1,byref p2 )
     dim chop_itemLength,chop_location

     chop_itemLength = len( item )
     chop_location = instr( 1,s,item,vbBinaryCompare )

     p1 = mid( s,1,chop_location - 1 )
     p2 = mid( s,chop_location + chop_itemLength,len( s ) )
end function


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-06-24 9:10:56 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search