cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SmoothOperator
Advocate I
Advocate I

String manipulation on both start and end

Hello,

 

I have a variable called varBase which has a looooong string value inside. 

I want to "trim it" and especially delete some characters on both start and end of this value. 

I have managed to remove the first 22 characters that I want out, by using :
Right(varBase, Len(varBase) -22)

 

However, simultaneously i want to remove the double quote character "  [Ascii 34 / Char(34)] at the end.
Any ideas anyone?

1 ACCEPTED SOLUTION

Accepted Solutions
rubin_boer
Super User
Super User

hi @SmoothOperator  Mid(Right(varBase, Len(varBase) -22),1,len(Right(varBase, Len(varBase) -22))-1)

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

View solution in original post

3 REPLIES 3
rubin_boer
Super User
Super User

hi @SmoothOperator  Mid(Right(varBase, Len(varBase) -22),1,len(Right(varBase, Len(varBase) -22))-1)

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.
Drrickryp
Super User
Super User

 

@SmoothOperator 

Substitute(Right(varBase, Len(varBase) -22),""","")

if there was only one " in the string.  If there are more and you want to replace the last one

With(
    {no:CountRows(MatchAll(varBase, """)),
Substitute(Right(varBase, Len(varBase) -22),""","",no)

 

SmoothOperator
Advocate I
Advocate I

really appreciate your quick responses!!! @Drrickryp @rubin_boer 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,616)