• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 133
  • Last Modified:

Looking at characters in a string

I am working on a program that reads an .ini file.  My .ini file looks something like this

I know how to read this into a variable, but I don't know how search for specific character.  I want to beable to search for the = sign, and when it comes across the = sign it will then get everything to the right of it.   I hope I explained this right.  I look all through the MSDN and could find anything on this....Thanks  

  • 2
1 Solution
This might work for you:

  Dim sOriginal As String
  Dim sRightSide As String
  Dim iEqualsPosition As Integer
  sOriginal = "BitRate=5333333"
  iEqualsPosition = InStr(sOriginal, "=")
  If (iEqualsPosition > 0) Then
      sRightSide = Mid(sOriginal, iEqualsPosition + 1)
      MsgBox "Couldn't find an equals to split on"
  End If

Also, there are WinAPI functions to retrieve data from an INI file, if you don't want to write your own.  I can't find a VB example offhand, but try looking for GetPrivateProfileString in WinAPI documentation.
strongdAuthor Commented:
This will work.....thanks

strongdAuthor Commented:
This will work.....thanks

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.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now