homecode zoneQuick Codedownloadssubmit codeabout usfeedbackscontact ussitemap
 
Beginners
Database
File System Object
General
Graphics
Multimedia
Networking
Shell Object
Timer
Array
Date/Time
Declaration
Error Handling
File/Folder
Logic
Loops & Conditional
Math
Miscellaneous
Strings
Values
Pro - Languages
C/C++
Java
Visual basic
asp
vb.net 2003/2005
asp.net
Quick Code
SUBMIT CODE
Mail List
LINKS
Submit LINK
 
ProgrammerGuide.net - VB String.
Home » VB Zone » String

Left and Right functions

Returns a Variant (String) containing a specified number of characters from the right side of a string.
Syntax : Left(string, length) | Right(string, length)
Example:

dim AnyString, MyStr
AnyString = "Hello World" ' Define string.
MyStr = Right(AnyString, 1) ' Returns "d".
MyStr = Right(AnyString, 6) ' Returns " World".
MyStr = Right(AnyString, 20) ' Returns "Hello World".

Asc functions

Returns an Integer representing the character code corresponding to the first letter in a string.
Syntax: Asc(string)

Example:
 
Dim MyNumber
MyNumber = Asc("A") ' Returns 65.
MyNumber = Asc("a") ' Returns 97.
MyNumber = Asc("Apple") ' Returns 65.

Base 0 & 1

Option Base {0 | 1}. Because the default base is 0, the Option Base statement is never required. If used, the statement must appear ina module before any procedures. Option Base can appear only once in a module and must precede arraydeclarations that include dimensions.The Option Base statement only affects the lower bound of arrays in the module where the statement is located

Example:

Dim iNumber(15 To 114) As Integer.

Chr Function

Returns a String containing the character associated with the specified character code.The required charcode argument is a Long that identifies a character.

Syntax:
Chr(charcode)

Example:
Dim MyChar
MyChar = Chr(65) ' Returns A.
MyChar = Chr(97) ' Returns a.
MyChar = Chr(62) ' Returns >.
MyChar = Chr(37) ' Returns %.

FormatCurrency, FormatPercent, FormatNumber

Syntax: FormatCurrency(Expression[,NumDigitsAfterDecimal[,IncludeLeadingDigit[,UseParensForNegativeNumbers [,GroupDigits]]]]), FormatPercent(Expression[,NumDigitsAfterDecimal [,IncludeLeadingDigit [,UseParensForNegativeNumbers
[,GroupDigits]]]]) FormatNumber(Expression[,NumDigitsAfterDecimal [,IncludeLeadingDigit
[,UseParensForNegativeNumbers [,GroupDigits]]]])

Part Description
Expression Required. Expression to be formatted.
NumDigitsAfterDecimal Optional. Numeric value indicating how many places to the right of the decimal are displayed. Default value is –1,which indicates that the computer's regional settings are used
IncludeLeadingDigit Optional. Tristate constant that indicates whether or not a leading zero is displayed for fractional values. See Settings section for values
Use Parents For (-)No Optional. Tristate constant that indicates whether or not place negative values within parentheses. See Setting section for values.

« Previous 1 2 3 Next »

Viewers: 16
Visitors:127291
Last Updated on:Sunday, January 17, 2010
Home | About us | Feedback | Contact us | Sitemap
Copyright © 2008 ProgrammerGuide.net. All rights reserved.
This site is best viewed in IE 6.0, Firefox 1.5 and above with screen resolution of 1024 X 768.