reset password
Author Message
michaelkou
Posts: 7
Posted 22:17 May 16, 2016 |

Does the special character only includes @ ! $ * # & % ? or every special characters?

michaelkou
Posts: 7
Posted 22:32 May 16, 2016 |

Nevermind I got it!

velder0
Posts: 16
Posted 00:03 May 17, 2016 |

did you figure out how to check for the special characters?

I've tried everything thats the only part of my code thats not working.

It always comes out false.

any hints?

Last edited by velder0 at 00:03 May 17, 2016.
rcamach7
Posts: 31
Posted 00:54 May 17, 2016 |

I used a counter while the loop goes through the string. If a special character comes out, I add one. At the end, you can use the counter to tell whether or not the requirement was met.

Last edited by rcamach7 at 00:56 May 17, 2016.
velder0
Posts: 16
Posted 01:28 May 17, 2016 |

yah I have a counter going and its worked for all the other requierments

but since I used a different if statement I don't think its reading it properly.

I made a new string for the special characters and then made an if statement to check for the characters.

but for some reason my counter isn't counting them.

rcamach7
Posts: 31
Posted 01:54 May 17, 2016 |

A string? You shouldn't compare strings to characters. While you get each character in the password, you check if the current char equals that of a special character, but separate each special character into a different chars ('x' instead of "x")

Separate each one, the if statement should check for each character individually and with single quotes signifying it's a char, rather than a string.

Last edited by rcamach7 at 01:57 May 17, 2016.
velder0
Posts: 16
Posted 02:32 May 17, 2016 |

finally got it.

probably used the most inefficient way but it works! 

thank you