is there an equivalent for string concatination in vbscript that can substract a string

I have a string A :
123456
and
I have a string B
456

I want to have the string 123 returned.

I want to do this in vbscript
itbabeAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
something like
replace( A, B, "")
should do the work...
0
 
nepostojeci_emailCommented:
These links would be very useful to you:

"Parsing strings in ASP using VBscript functions"
http://www.codefixer.com/tutorials/parsing_strings.asp

-----------------------------------------------------------------------

InStr(StringToSearch, StringToFind)
The Function will return the position of the first occurence of StringToFind within StringToSearch. The Function will return 0 if StringToFind is not found.

-----------------------------------------------------------------------

The Left Function
Syntax: Left(String, NumofCharactersToGetFromString)

The Function will return the number of characters you stipulate. As is obvious it starts from the left.

Example:

<%
String1="Michael"
response.write "The first 3 letters of my name are " & Left(String1,3)
%>
Output:
The first 3 letters of my name are Mic

-----------------------------------------------------------------------

Replace VBScript function
The Replace function can be used to replace certain characters within a string with other characters.

Syntax:Replace(StringToSearch, StringToFind, ReplaceWithThisString)

StringtoSearch is the string you want to check for any occurence of the StringToFind. If there are any occurences of StringToFind then the function will replace them with ReplaceWithThisString. Every occurence will be replaced starting from the first character of StringToSearch.

Example:

<%
String1="My_Name_is_Michael"
Response.write Replace(String1,"_"," ")
%>
Result displayed on the screen would be:
My Name is Michael

-----------------------------------------------------------------------

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.