0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

文字列から制御文字を削除する

Last updated at Posted at 2016-12-11

課題

RFIDリーダなどの機器からシリアル通信で送られてきた文字列をprintlnでそのまま表示すると

received: 0511

received: 0511

received: 0511

となってしまうのを

received: 00511
received: 0511
received: 0511

としたい.

原因

受信した文字列に制御文字が含まれていることが原因

解決策

tirm()で制御文字やスペースを削除する

myString = trim(myString);

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?