web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to trim the last c...
Power Automate
Unanswered

How to trim the last character in string

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

How can I trim the last character from a string where I am concatenating the email address with ; as delimiter? I do not need the last semi-colon.

 

Any help is much appreciated.

Categories:
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     
     
    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • VictorIvanidze Profile Picture
    13,083 on at
    replace(variables('mailboxAddress'),';','')
  • Lenfant Profile Picture
    8 on at

    Hi Neha56,

     

    Did you manage to resolve this?  I'm trying to do something very similar and the link suggested does not seem to work.

  • VictorIvanidze Profile Picture
    13,083 on at

    Hi @Anonymous,

    did you try to use

    replace(variables('mailboxAddress'),';','') 

  • Lenfant Profile Picture
    8 on at

    This solution will replace all instances of ';' which is not quite what I wanted.  I finally opted for the solution in https://powerusers.microsoft.com/t5/General-Power-Automate/Removing-the-last-character-in-the-string...

     

    This worked, albeit a small typo by me which is why it didn't work first time.

  • Jaco_Campher Profile Picture
    99 on at

    For anyone else looking, this will only remove the trailing ; if it is there.


    if(equals(last(triggerBody()['email']), ';'), substring(triggerBody()['email'], 0, add(length(triggerBody()['email']), -1)), triggerBody()['email'])

     

    Replace the text in blue with your input.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 213 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 151

Last 30 days Overall leaderboard