cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dsab81
Microsoft
Microsoft

Find the Spaces in a String

I have a string which may have a space any where.

e.g here : I have a space in the first character and in between words. 

' foot ba ll'

 

I need a formulae to find, if any space exists in my string and remove all spaces if exists.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
zmansuri
Super User
Super User

a17.jpg

CountRows(MatchAll("www.hot m a il .com", " "))

 Above formula will count the number of occurrence of the character in a string. In this case. 4 Spaces.

View solution in original post

a19.jpg

 

sub(length(split(variables('test'),' ')),1)
 
Please click accept as solution if i have solved your problem. So, it will be helpful for others to find this post.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

hi @dsab81 ,

try this : 

Substitute(YourString," ","")

 

dsab81
Microsoft
Microsoft

@Anonymous  Before removing spaces, May i know how do i find, if there is any space in a string ?

Or

I need the count of spaces in a string.

zmansuri
Super User
Super User

a17.jpg

CountRows(MatchAll("www.hot m a il .com", " "))

 Above formula will count the number of occurrence of the character in a string. In this case. 4 Spaces.

dsab81
Microsoft
Microsoft

@zmansuri  Thanks. May i know the power automate equivalent of this formulae to get the count of spaces

a19.jpg

 

sub(length(split(variables('test'),' ')),1)
 
Please click accept as solution if i have solved your problem. So, it will be helpful for others to find this post.
dsab81
Microsoft
Microsoft

Works perfectly @zmansuri . Thank you.

dsab81
Microsoft
Microsoft

Hi @zmansuri Using the same formulae how can i get the count of upper case letters in a string ?

 

Please provide it here.

https://powerusers.microsoft.com/t5/Building-Flows/Count-of-Upper-Case-Letters-in-a-String/m-p/93983...

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,916)