摘要:
字符串连接 方法1: 用字符串的join方法 方法2: 用字符串的替换占位符替换 字符串截取 我们可以通过索引来提取想要获取的字符,可以把python的字符串也做为字符串的列表就更好理解python的字串列表有2种取值顺序1是从左到右索引默认0开始的,最大范围是字符串长度少1s = 'ilovepy 阅读全文
摘要:
Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For 阅读全文
摘要:
在写C++程序中,总会遇到要从一个字符串中查找一小段子字符串的情况,对于在C中,我们经常用到strstr()或者strchr()这两种方法。而对于C++的string,我们往往会用到find()。 C++:#inlcude<string>C: #include<string.h>find():在一个 阅读全文
摘要:
Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the or 阅读全文