Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
utils.cpp
- Committer:
- bvirk
- Date:
- 2020-02-24
- Revision:
- 7:7b225c565fe6
- Child:
- 9:d15f84b277f3
File content as of revision 7:7b225c565fe6:
#include "MicroBit.h" #include "cppNorm.h" string trailedWith(const string src, char trailChar, int length) { if (length <= src.length()) return src; char buf[length+1]; memcpy(buf,src.toCharArray(),src.length()); memset(buf+src.length(),trailChar, length-src.length()); buf[length]='\0'; return string(buf); }