Find and replaces spaces from a input string with * - MATLAB Cody - MATLAB Central

Problem 1824. Find and replaces spaces from a input string with *

Difficulty:Rate

For a given input string str, find how many spaces are there in the string and replace those spaces with * e.g. str = 'this is demo of replacing spaces with stars'; Then, out = 'this*is*demo*of*replacing*spaces*with*stars'

Solution Stats

83.25% Correct | 16.75% Incorrect
Last Solution submitted on Apr 30, 2025

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
2
3

Problem Recent Solvers165

Suggested Problems

More from this Author25

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!