How can remove space between number

Main Sheet graph.xlsx (9.5 KB)
Dears pleas any one have idea how i can remove the space between number as shown in snap
i want check all the cells and if there is space i want removed it


read cell then use replace " " with β€œβ€
use excel appl scope inside it For each row then use assign activity in which assign
row(column index)=row(column index).tostring.replace(" β€œ,”")


Suppose you are having a variable , strValue
Try this
strValue= strValue.replace(" β€œ,”")

Hope it will help!!

could you please check my xaml because it’s not working

also with Read Cell get this error

Hi @Mohamed_Abbas ,

You can use row(0)= row(0).ToString.Replace(" ",string.Empty) in the assignment activity.

Warm regards,

Hi @Mohamed_Abbas,

You are getting the above error because, row(1) doesn’t have any contents. From your screenshot, its look like you are using read cell activity instead of read range activity. Please use β€˜Read Range’ activity with your desired range.

Warm regards,

thanks dear but still not working o modified as you say

Hi @Mohamed_Abbas,

Are you sure you are writing the modified datatable β€˜DT1’ back to the excel file?
Please use a write line activity with text row(0).ToString after you removing the whitespace from row(0) to verify it.


Hi @nimin

like this

Hi @Mohamed_Abbas,

Yes. Please check your output panel and verify your output.


1 Like

If you are trying to use String.Replace(" β€œ,β€β€œ), this will remove only the first occurence of the " β€œ. If there are more than one occurences like 12 21. 98, post replace, value will be 1221. 98
The efficient way to replace all space is by using regular expression.
newvalue = Regex.Replace(inputString, @”\s+”, β€œβ€)


Hi Abbas,

You can put one check ,like

if string.isnullorempty(strValue) ,
if boolean is false than implement replacement of space with nothing.

Hello Hope you got your solution as @Madhavi @nimin suggest you
if still having prob then pls refer below wf for your excel file (17.4 KB)

Pls make changes as per your need !


Thanks Dear
issue already solved as @nimin @Madhavi say

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.