Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display tabs(whitespace) coming from MySQL database correctly on both in Android and IOS app?

Tags:

android

mysql

ios

I have following data in my db row:

Espresso:                           7,00

Double Espresso:                    8,00

Ristretto:                          7,00

Espresso Machiato:                  8,00

Espresso Con Panna:                 8,00

I write it on Word, then copy & paste to MySQL editor. When I save it, my IOS and Android apps cannot show the prices aligned because of the tab characters.

enter image description here

What is the best way to do that?

like image 355
Burak Avatar asked Jul 08 '14 08:07

Burak


People also ask

Where is whitespace in MySQL?

SPACE() function MySQL SPACE() returns the string containing a number of spaces specified as an argument.

How do I strip spaces in MySQL?

The TRIM() function returns a string that has unwanted characters removed. Note that to remove the leading spaces from a string, you use the LTRIM() function. And to remove trailing spaces from a string, you use the RTRIM() function.


1 Answers

The best way- those 2 things are different data and are in different columns in your database, I would expect (if not, you need to fix your schema). So put the 2 strings in separate TextViews, and align the text view in xml.

like image 70
Gabe Sechan Avatar answered Oct 27 '22 09:10

Gabe Sechan