Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Ayoub
Contributor III
Contributor III

Remove blank spaces between a string

Hello Community

if i have too much space between 2 String  like that 'new             quest'

and i want to get this  result 'new quest'  with one space between new and quest.  

How can I do that ? 

i Did this : SubField('new quest',' ',1)& ' ' &SubField('new quest',' ',2) but it works only with one space between the two words 

 

Thank you Again 

4 Replies
m_woolf
Master II
Master II

Something like this:

Left(index(String,' ')-1) & ' ' & mid(index(String,' ',-1)+1)

Vegar
MVP
MVP

This will work

= SubField('new     quest',' ',1)& ' ' &SubField('new     quest',' ',-1) 
Ayoub
Contributor III
Contributor III
Author

Hello @Vegar 
thank you for ur answer it works like magic but what if i had 3 words 
cause in the application which i'm working on .; i shoud delete all blank spaces between the words  and i  could have 3 or 4 word in one String 😕 

(Sorry abt my english) 

Thank you again 

Vegar
MVP
MVP

I have not verified it, but this might do the trick

Concat( trim(subfield( Field, ' ')), ' ')

BR
Vegar