How to remove a part of a character?

1 次查看(过去 30 天)
Hi all,
Suppose that I have a character called Date='1938-03-01'. I want to remove the year part(1983). 1983 is just an example. I want to remove any year form the date. How can I do that?

采纳的回答

Voss
Voss 2023-1-3
编辑:Voss 2023-1-3
Date = '1938-03-01';
Date(1:4) = []
Date = '-03-01'

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by