Hi Shubham,
You can use the function replace all (to delete all spaces inside a string) and trim (to delete all space at the beginning and at the end of the string):
trim(replaceAll($Object/Name, ' ', ''))
For more information you can look here: https://docs.mendix.com/refguide/string-function-calls/#13-replaceall and https://docs.mendix.com/refguide/string-function-calls/#11-trim
This will do it:
replaceAll($YourString, ' ', '')