My string is XY_FolderName_90342134, I want it to be XY_FN_90342134

Hi Forum, Can you please help me out with the above issue?
My string is XY_FolderName_90342134, I want it to be XY_FN_90342134

Basically the Name between the underscore should only consist of upper case characters. rest all should remain same

Hi, @Murthy_Chethana

Can use Replace;

Name.Replace("FolderName","FN")

Hi @Murthy_Chethana ,
Try with this solution:

  1. strInput(String Type) = “XY_FolderName_90342134”
  2. strSplitInput (String Type) = strInput.Split("_"c)(1)
  3. strModifiedName(String Type) = System.Text.RegularExpressions.Regex.Replace(strSplitInput, “[^A-Z]”, “”).ToUpper()
  4. strFinalOutput (String Type) = strInput.Replace(strSplitInput,strModifiedName)

Thanks

Hi manisha,
Assign: Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled.
I am getting this error while processing the regex

@Murthy_Chethana ,
FileName.xaml (7.7 KB)
Shared the workflow. Please check

It is working thank you

1 Like

Hi Manisha,
Let’s say XY_FolderName_90342134

I want the number as well

@Murthy_Chethana , Didn’t get it. Please elaborate your question

XY_FolderName_90342134
eg: XY_FolderName2_90342134
XY_FolderName7_90342134

I need the output to be:
XY_FN2_90342134
XY_FN7_90342134

@Murthy_Chethana
FileName.xaml (8.0 KB)
Shared the workflow.

Thanks,

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