Re: [Vala] Handling multiline strings



Yeah. I'm using what Mario suggested. I just needed a better looking
alternative. I guess I want to avoid string manipulation and stay that way
:(


On 10 June 2013 20:06, Craig <weberc2 gmail com> wrote:

Alternatively, if you want the string literal to look presentable and you
know it will l not have tabs, you can strip said tabs from the string. But
generally Mario's suggestion is preferred, I think.
On Jun 10, 2013 8:04 AM, "Mario Daniel Ruiz Saavedra" <
desiderantes rocketmail com> wrote:

Use: string new = "Line 1 and %s\nLine 2 and %s\nLine 3\nLine
4".printf(var1,var2);
_______________________________________________
Mario Daniel Ruiz Saavedra
Estudiante Ing. Sistemas - Uninorte
mruizd uninorte edu co - identi.ca/desiderantes

-----Original Message-----
From: Satyajit Sahoo <satyajit happy gmail com>
Sender: "vala-list" <vala-list-bounces gnome org>
Date: Mon, 10 Jun 2013 18:22:49
To: vala-list<vala-list gnome org>
Subject: [Vala] Handling multiline strings

Hi. I'm trying to write a multiline string into a file,

e.g.

string new = """Line 1 and %s

Line 2 and %s

Line 3

Line 4""".printf (var1, var2);

The problem is, when I write it to the file, the lines from the 2nd line,
have tab characters preceding them. I want to keep the idention level of
the code to improve redability. How can I make it ignore the tabs used
for
code indention while writing to the file?


--
Satyajit Sahoo
Profile - Facebook <http://facebook.com/satya164>,
Google+<http://plus.google.com/u/0/114564489020097923600>
Artwork - DeviantArt <http://satya164.deviantart.com>
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list

_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list




-- 
Satyajit Sahoo
Profile - Facebook <http://facebook.com/satya164>,
Google+<http://plus.google.com/u/0/114564489020097923600>
Artwork - DeviantArt <http://satya164.deviantart.com>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]