English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i have a string:
'Title=some title'

i would like to get the string 'some title'. how should i go about doing it? thanks.

2006-12-11 15:47:18 · 3 answers · asked by fang 4 in Computers & Internet Programming & Design

3 answers

You can use a function like this:

Function GetParam(cKey As String) As String
Dim nPos As Integer

nPos = InStr(1, cKey, "=") + 1
GetParam = Mid(cKey, nPos, Len(cKey) - nPos + 1)
End Function

just call this function with something like:

cParam = GetParam("Title=some title")

2006-12-11 17:18:36 · answer #1 · answered by Anonymous · 0 0

Dim myString as String

myString = "Title=some title"

Dim result as String
Dim index as Integer
Dim length as Integer

index = InStr(myString, "=")
length = Len(myString)

result = Right(myString, length - index)

'result should equal "some title"

I don't have a VB6 environment available right now so there might be some minor bugs, but that's the general algorithm.

2006-12-12 00:15:38 · answer #2 · answered by Mike Deck 1 · 0 0

Dim myStr as string
'to write My Title into a text box or label
myStr = "My Title"
textbox1.text = myStr
label1.text = myStr

'to get the title entered into a textbox called txtTitle

myStr = txtTitle.text

2006-12-12 00:06:12 · answer #3 · answered by MarkG 7 · 0 0

fedest.com, questions and answers