473,385 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

toString align problem

suppose there're three String a[], b[] and c[], the length are not fixed.
how can i make the format a[] b[] c[] so that three arrays align to the
left?

ok, i know it's stupid.. but i don't think using StringTokenizer to
implement my own format is a good idea... plez help me out, thanks a lot!

Jul 17 '05 #1
2 2185

"Chen Yang" <NO****@hotmail.com> wrote in message
news:Ih*********************@news4.srv.hcvlny.cv.n et...
suppose there're three String a[], b[] and c[], the length are not fixed.
how can i make the format a[] b[] c[] so that three arrays align to the
left?

ok, i know it's stupid.. but i don't think using StringTokenizer to
implement my own format is a good idea... plez help me out, thanks a lot!


So there are three string arrays, and you want to print in columns?

Loop through each to find the longest one, then print each followed by
enough space to make them align.

I think there is a method in String that will repeat a character some number
of times.

-- glen
Jul 17 '05 #2
nos
be sure to use a font that has equal width characters

"Glen Herrmannsfeldt" <ga*@ugcs.caltech.edu> wrote in message
news:_UGpb.101148$Tr4.273598@attbi_s03...

"Chen Yang" <NO****@hotmail.com> wrote in message
news:Ih*********************@news4.srv.hcvlny.cv.n et...
suppose there're three String a[], b[] and c[], the length are not fixed. how can i make the format a[] b[] c[] so that three arrays align to the
left?

ok, i know it's stupid.. but i don't think using StringTokenizer to
implement my own format is a good idea... plez help me out, thanks a
lot!
So there are three string arrays, and you want to print in columns?

Loop through each to find the longest one, then print each followed by
enough space to make them align.

I think there is a method in String that will repeat a character some number of times.

-- glen

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Phil Powell | last post by:
Code: <!-- script src="/js/val_header.js"></script --> <style> <!-- BODY { scrollbar-3d-light-color:#eeeedd; scrollbar-arrow-color:#000000; scrollbar-base-color:#000000;...
10
by: Markus Ernst | last post by:
Hi I have a strange problem with vertical-align. The case can be viewed at http://www.brainput.info/geschichte.html. HTML code: <div id="bild"><img src="geschichte.gif" width="274"...
8
by: André Hänsel | last post by:
Hi! When I put a table into a table and try to align it right, it works in IE but not in Firefox. Simplest code to reproduce: <html> <body> <table style="width: 100%"> <tr>
14
by: artifact.one | last post by:
It'd be really pleasant (in my opinion) if the next revision of the C language actually allowed some portable control over data alignment. Compiler-specific mechanisms for this stuff are so...
3
by: acunnon | last post by:
I am trying to put together an login page my problem is getting the three items aligned to the middle verticaly without specifing a height to anything on the page. CSS html{ height:100%;...
2
by: esteuart | last post by:
I need to get the right combination for a div to clip any text inside and allow vertical alignment. I only have this problem in FireFox. I have 3 divs nested within each other. The outer div has...
6
shane3341436
by: shane3341436 | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta...
40
by: maya | last post by:
hi, how do I get text to vertical-align inside a div? http://www.mayacove.com/misc/home.html vertical-align should work, according to this:...
13
by: Stevo | last post by:
I've found that for IE6+, if you add the property text-align:center to a DIV, then *anything* inside it gets centered. That can be a table, an object/embed, another DIV, an image, or some text. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.