The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
TyeshaAdams
1 year 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 "mmmmmmmmmUSxxxxx...
- 1 year ago
You should have a look at regular expressions. It is a little cryptic but very powerful. Microsoft provides all the information you need to parse complex strings.
MarcusH
1 year agoValued Contributor
I would use XFContainsIgnoreCase rather than the standard VB Contains.
If sText.XFContainsIgnoreCase("US") Then
It won't make a difference to this script as the source is already upper case but it's a good practice to get into.
Secondly I agree with SimonHesford that a debug of some sort is needed as the code looks OK. I would have an Else statement such as:
If sText.XFContainsIgnoreCase("US") Then
result = sText.Substring(sText.IndexOf("US"),8)
Else
result = $"Text [{sText}] does not contain US"
End If
Related Content
- 3 years ago
- 2 years ago
- 3 years ago
- 4 years ago