something fishy about Cody use of regexp?

1 visualización (últimos 30 días)
Erik
Erik el 6 de Jul. de 2012
I am playing around with the Cody problems...
The following function seems to do precisely what I want it to do when I run it locally (i.e., remove leading and trailing spaces, where space is only ASCII char 32), yet when I submit it to Cody, it fails each and every test case.
There seems to be a big difference between what is happening locally and what is happening within the Cody judge. Any ideas?
function b = removeSpaces(a)
ca = regexp(a, '^ *([^ ].*[^ ]) *', 'tokens');
b = ca{1};
end

Respuestas (0)

Categorías

Más información sobre Historical Contests en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by