MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   在Matlab中将每个单词的首字母大写/大写? (https://www.labfans.com/bbs/showthread.php?t=23151)

poster 2019-12-10 20:30

在Matlab中将每个单词的首字母大写/大写?
 
在Matlab中大写/大写字符串中每个单词的第一个字母的最佳方法是什么?


[I]西班牙的雨主要落在飞机上[/I]

[I]西班牙的雨主要落在飞机上[/I]



[B]回答:[/B]

所以使用字符串

str='the rain in spain falls mainly on the plain.' 只需在Matlab中使用regexp替换函数regexprep

regexprep(str,'(\


所有时间均为北京时间。现在的时间是 04:56

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.