reset password
Author Message
KA1997
Posts: 31
Posted 00:28 Apr 11, 2017 |

How do we even get every single substring for a word?

jzunig20
Posts: 38
Posted 00:45 Apr 11, 2017 |

try s1.substring(x, y) 

KA1997
Posts: 31
Posted 17:22 Apr 11, 2017 |
jzunig20 wrote:

try s1.substring(x, y) 

That could get every possible substring for every possible length?

jzunig20
Posts: 38
Posted 17:23 Apr 11, 2017 |

if you set up the indices accordingly you can

KA1997
Posts: 31
Posted 18:14 Apr 11, 2017 |
jzunig20 wrote:

if you set up the indices accordingly you can

And that must be inside a loop, right?

jzunig20
Posts: 38
Posted 18:28 Apr 11, 2017 |

well the substring indices have to change so i think otherwise how would it change from index to index

KA1997
Posts: 31
Posted 19:12 Apr 11, 2017 |

I kind of figured that out. But I can't figure out how to increase int  n by 1 every time, then do the loop again, until it reaches the string length.

Last edited by KA1997 at 19:42 Apr 11, 2017.
KA1997
Posts: 31
Posted 19:39 Apr 11, 2017 |

Nevermind, I got it

jgarc629
Posts: 76
Posted 22:52 Apr 11, 2017 |

I'm still confused with it, can someone explain it?