deblank
Trims trailing whitespaces from strings, matrices and cell arrays. For matrices, trailing whitespaces are stripped from each row to the size of the longest string in the matrix, to make the length of each row consistent.
Syntax
R = deblank(s)
Inputs
- s
- Type: string | mat | cell
Outputs
- R
- Type: string | mat | cell
Examples
R = deblank(' deblankExample1 ')
R = deblankExample1
R = deblank([' string1234 '; ' string12 '])
R =
string1234
string12
R = deblank({'123 ', ' example3 '})
R =
{
[1,1] 123
[1,2] example3
}