How to remove the first and last character in string value?

Hi everyone. 


So I wanted to remove the first and the last character in a value, it's a JSON format that I obtained from an API. Apparently it returned some escape strings that should be removed to deserialize the response. Example: 

"{\"20200619114321\":{\"absensi_date\":\"19-JUN-2020\",\"status_clock_out\":null}}"


I want to remove the double quote in the value. What function should I use? Replace? Substr? thanks.

Aditya Eka Prabowo wrote:

Hi everyone. 


So I wanted to remove the first and the last character in a value, it's a JSON format that I obtained from an API. Apparently it returned some escape strings that should be removed to deserialize the response. Example: 

"{\"20200619114321\":{\"absensi_date\":\"19-JUN-2020\",\"status_clock_out\":null}}"


I want to remove the double quote in the value. What function should I use? Replace? Substr? thanks.


Hi,


Use Substr and Length function to remove first and last character from the string.


Thanks!

Solution

See below formula,

Val - your string.

SyntaxEditor Code Snippet

Substr(Val,1,Length(Val)-1)
Solution

hI aDITYA,

Based on your string you need to use this

SyntaxEditor Code Snippet

Substr(Txt,1,Length(Txt)-2)

where "txt" is your string.


regards

Rahul Sahu

Hi Jitendra and Rahul, thanks this problem is solved. Actually this is the alternative to my primary case, which leads to this post: https://www.outsystems.com/forums/discussion/62041/response-value-of-an-api-is-a-plaintext-can-i-create-a-list-from-it/


Anyway thanks again for the answers.