Posts by ricardo • 208 points
3 posts
-
1
votes1
answer2738
viewsA: How to remove unwanted characters from a list of strings?
This should work novo = [] for x in lista: item = x for y in ['\n', '\t', '/', '.', '-', '(', ')']: item = item.replace(y, "") novo.append(item) or novo = [] for x in lista:…
-
1
votes3
answers4410
viewsA: How to remove whitespace from a string with Regex in PHP?
Use the ltrim command to remove the start space and rtrim to remove from the end. Or just Trim to remove from the end and start: echo ltrim(" |ola mundo|"); to remove space has str_replace echo…
-
7
votes1
answer1549
viewsQ: Mysql query equal to one value or another
I’m having a doubt in a query mysql. I have this query select cor from cores where cor in('verde','vermelho'); The problem is that I want the green, and If there is no green I want the red. but not…