I have the one of the following from data input:
TRANSPORTATION OF TEMPERATURE CONTROLLED PRODUCT @ -10°F (could be any temperature between -10 and 70°F)
- OR -
TRANSPORTATION OF TEMPERATURE CONTROLLED PRODUCT @ DRY
I want to extract ONLY -10 or DRY (whichever is present) and place it in another textbox. Notice DRY does not have the "°F" after it.
I suspect a CASE Select will be required but unsure how to pull out only the actual temperature w/o the °F
Currently I'm using code to take only the last 5 character out of the string as follows:
Needless to say, this is not working properly and I end up with either "@ DRY" or -10°F - as expected. I really need to be able to end up with either "DRY" or "-10" - as my end result. I figured a "between" statement would work but unsure how to properly code this.Code:Dim strSetTemp = MyList.Items.Item(196).ToString Dim strTemp As String = strSetTemp.Substring(strSetTemp.Length - 5) Select Case strTemp Case "DRY" tbTemp.Text = "DRY" Case Else tbTemp.Text = strTemp End Select




Reply With Quote
