TyeshaAdams
5 months agoNew Contributor III
Parser Business Rule
I am trying to write a parser business rule to give the portion of a string that begins with US and the 6 characters after from a data source.
For example, the imported line reads "mmmmmmmmmUSxxxxxxmmmmmmm" and I want to parse out USxxxxxx to which is mapped in the transformation rules. I also need it to be dynamic because the line will not always be in the same character place. It could also be "mmmmmUSxxxxxxmmm" or anywhere else within the text. I have tried using the rule below but it is not bringing back any values. The import is reflecting "blank."
Dim sText As String = args.Value
Dim result As String = ""
If sText.Contains("US") Then
result = sText.Substring(sText.IndexOf("US"),8)
End If
Return result