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)

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)

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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,819)