cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TimmyBoy
Post Patron
Post Patron

htmltext trim

Hello,

Is it possible to trim the text in 3 parts?

Demo: John Doe First

Even if some customer has a name Mary Jane

Subtitle_Cust => a label

For example, i use in HtmlText Label

"<b>" &
Left(Subtitle_Cust,
Find(Last(FirstN(Split(Subtitle_Cust, " "),2)).Result
,Subtitle_Cust)-1)
&
"<font color=blue>" & Trim(Last(FirstN(Split(Subtitle_Cust, " "),2)).Result) & "</font>"

This gives me John

Then blue gives me Doe

Now i still needs to display First

So i get John Doe First

Or Mary Jane

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @TimmyBoy ,

 

Please try:

 

"<b>" &
Last(FirstN(Split(Subtitle_Cust, " "),1)).Result
&" "&
"<font color=blue>" & Last(FirstN(Split(Subtitle_Cust, " "),2)).Result & "</font>"
&" "&
If(CountRows(Split(Subtitle_Cust, " "))>2,Last(FirstN(Split(Subtitle_Cust, " "),3)).Result,Blank())
& "</b>"

 

vxiaochenmsft_0-1670398696486.png

 

vxiaochenmsft_1-1670398696488.png

 

Best Regards,

Wearsky


View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @TimmyBoy ,

 

Please try:

 

"<b>" &
Last(FirstN(Split(Subtitle_Cust, " "),1)).Result
&" "&
"<font color=blue>" & Last(FirstN(Split(Subtitle_Cust, " "),2)).Result & "</font>"
&" "&
If(CountRows(Split(Subtitle_Cust, " "))>2,Last(FirstN(Split(Subtitle_Cust, " "),3)).Result,Blank())
& "</b>"

 

vxiaochenmsft_0-1670398696486.png

 

vxiaochenmsft_1-1670398696488.png

 

Best Regards,

Wearsky


@v-xiaochen-msft 

Just awesome, yes this is what i was looking for 😄

Thank you so much.

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 (2,401)