摘要: 1. substr() 方法使用 string substr (size_t pos = 0, size_t len = npos) const;pos: 截取初始位置(从头开始截取pos=0)len: 截取字符长度 1 // using substr 2 string fullName = "Sh 阅读全文
posted @ 2020-02-28 14:21 SheepCore 阅读(3255) 评论(0) 推荐(0) 编辑
摘要: 1. 使用string()构造函数方法 1 //method 1: the constructor of string() 2 char c = 'F'; 3 string s = string(1, c); 4 cout << s ; 2. 使用stringstream字符流 1 //method 阅读全文
posted @ 2020-02-28 13:44 SheepCore 阅读(4257) 评论(0) 推荐(1) 编辑
摘要: 1.Description: 2.Example: Input: 12345 Output: one five 3.solutions: C Version: 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 5 i 阅读全文
posted @ 2020-02-28 08:02 SheepCore 阅读(217) 评论(0) 推荐(0) 编辑