Skip to main content

Hi Team,

I want to Trim the starting characters from a field in acumatica. I tried using “Split” function, but it is not working as expected.

Please help me on this.

 

 

Sample code:

 

Regards,

Ramya

Hi @ramya15 

You need to split with a front slash (\) and get the list. Then You can eliminate the first record and use the second one. Adjust the code as per your requirement.

 

Sample:
stringi] values = row.Name?.Split('\,');

 string value = values.Length > 1 ? valuesl1] : string.Empty;
                


Hi @ramya15  

Hope you are doing well!

You can use the normal C# code to substring based on the slash character. Please find the line below for reference.

 

https://stackoverflow.com/questions/1857513/get-substring-everything-before-certain-char

 

hope this helps!


Hi @ramya15 

You can use this in your solution, may be  it will help you for splitting (\) slash.

string value = @"Report Log(7 RL-000007)\SPYTL FRD Timecard V03-signed";
          value = value.Split('\\')l1]; 

 

Thank you..!


Hi @Naveen Boga/ @jinin 

Thanks for the response. hope you are doing well!!

I’m facing one more problem escape character ‘\’.  could you please help me yo rectify.

 

 


Thanks @Naveen Boga\ @NageswaraRaoAddanki60 \ @jinin 

 

after using “\\” it is working.

 

Regards,

Ramya


Awesome @ramya15  Thanks for sharing the update.


Reply