|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
VBScript - General - Question - String Operations
Hi
I' m struggling with the same problem maybe someone have the answer ? BR |
|
#2
|
||||
|
||||
|
--> Post split into new thread
Hi, Can you post a full description of your problem. Mystic resolved his issue using Split but we cant tell if that will work for you without seeing your code/problem. |
|
#3
|
|||
|
|||
|
I have a string sName = "Brown [ENG]" and i want to cut everything what is after " " and get only Brown.
Ansver in VB and c# would be ideal as there is no InStr in c# as far as i know or i don't know how to use it. |
|
#4
|
||||
|
||||
|
Quote:
In vbscript/ASP, you can use InStr, eg: Code:
Dim rawString, cleanString rawString = "Brown [ENG]" cleanString = Left(rawString, InStr(rawString, " ")-1) The C# equivalent of InStr is String.IndexOf() |
|
#5
|
|||
|
|||
|
worked great ! thanks a lot
c# version : Code:
sname = sname.Substring(0,sname.IndexOf(" "));
|
|
#6
|
||||
|
||||
|
Quote:
You're welcome, glad it helped. And thanks for posting the C# solution for reference!! ![]() |
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > VBScript - General - Question - String Operations |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|