字符串——打印所有子串

1     public static void printAllSubstring(String[] args) {
2         String s = "asdfs";
3         for(int i=0; i<s.length(); i++) {
4             for(int j=i; j<s.length(); j++) {
5                 System.out.println(s.substring(i, j+1));
6             }
7         }
8     }
无论有多困难,都坚强的抬头挺胸,人生是一场醒悟,不要昨天,不要明天,只要今天。不一样的你我,不一样的心态,不一样的人生,顺其自然吧
原文地址:https://www.cnblogs.com/xiyangchen/p/10806784.html