Substring, regex, etc

Hello, i have variable:
Var1 = “axbxcxdxe 1x2x3x4 abcde CoreData.txt”
i want to get only CoreData.txt and remove the character behind Core words.
how the simply way to get it ?
iam already use right function to manipulate it but it seems not the proper way.
FYI the character behind CoreData it always changes.
thank you

@AndhikaDwi

Please try this

Say its stored in str variable

Str.Trim.Split({" "},StringSplitOptions.None)(Str.Split({" "},StringSplitOptions.None).Count-1)

This basically splits the data on space and then gets the last item from the output …same works for Last as well

Cheers

1 Like

Hi @AndhikaDwi

Give a try to this.
Split(“axbxcxdxe 1x2x3x4 abcde CoreData.txt”," ").Last

image

Hope this might help you.

1 Like

Hey @AndhikaDwi

image

MatchRegexVariable is of type string

Regex Forumm.zip (68.4 KB)

Hope this will help
Cheers.

6 Likes

Hi @AndhikaDwi ,

You can use Regex for this “(?<=\s)\w+.\w+$”

Hope this will help

1 Like

All of your suggest is solution thank you guys

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.