JONNALAGADDA Srinivas
JONNALAGADDA Srinivas

Reputation: 645

Fixed-width formatting in Dart

I am writing a script to generate a file with the structure of a molecule represented in MDL's `.mol' format. It requires writing several pieces of data with exactly specified widths (i.e., 2 characters and space-padded on the right, 3 characters and space-padded on the left, etc.). How do I do this in Dart? Thanks.

Upvotes: 3

Views: 631

Answers (1)

Cutch
Cutch

Reputation: 3575

This is currently not possible using string interpolation. There is a bug here:

http://code.google.com/p/dart/issues/detail?id=1694

You should star it to express your support in having this fixed.

In the meantime, you could manually construct a string character by character that fits your needs.

John

Upvotes: 2

Related Questions