How to Search Blank Line ?

8 次查看(过去 30 天)
dmfwlansejr
dmfwlansejr 2023-3-29
Hi- Everyone
I use 'isempty' to find an empty line.
But there is a problem
The left Side File, detect Line 4
The right file is undetectable. 'Isempty' can not be detected if there is a space
Is there any way to detect both cases?
(left file) (right file)

回答(1 个)

Walter Roberson
Walter Roberson 2023-3-29
Assuming a cell array
line_is_blank = cellfun(@(S)isempty(strtrim(S)), YourCellArray)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by