You don't do that with Strings. What you want is an enumeration.
vb.net Code:
Public Enum Example
Example1
Example2
End Enum
Your method could then look like this:
vb.net Code:
Public Function TestFunction(stringTestString As String, eg As Example) As Boolean
Select Case eg
Case Example.Example1
Return True
Case Example.Example2
Return False
End Select
End Function
You probably used various enumerations already, e.g. MessageBoxButtons or DialogResult. The idea is that the system uses numbers under the hood for efficiency but the developer uses identifiers in code for simplicity. The Integer values are implicitly assigned sequentially from zero or you can assign them explicitly if you want something different. If you were to just use raw Integer values then they would be meaningless in code unless you had prior knowledge, but Strings would be very inefficient when being used under the hood. Unlike both Integers and Strings, enumerations also let you limit the possible values to a small set. One thing to note is that, just like all identifiers, enumerations values must not contains spaces or other special characters and must start with either a letter or an underscore. If you want to be able to display a more user-friendly in your UI then you might like to follow the CodeBank link in my signature and check out my thread on just that subject.