Page 1 of 1

Address ToString with pattern

Posted: Fri Aug 06, 2010 1:13 pm
by isaacdiaz74
I want to format the address into a specific html format different than the format provided by ToString(). I know I can concatenate a string and geerate the html but I see the Address Object exposes a method ToString(string pattern, bool isHTML).

Could I use that? What's the format for the pattern string? I have searched and can't find any documentation about this method.

thanks a lot.

Re: Address ToString with pattern

Posted: Fri Aug 06, 2010 5:10 pm
by Logan Rhodehamel
Go to Configure -> Regions -> Countries. In the right column is an area to add new countries. By the address format is a link that says "what's this?".

If you click this link it will give you a list of the variables that are supported by the ToString method. It's a simple string substitution. So you could do something like

ToString("[Name]\n[Address]", true)

The boolean ishtml, if true, changes any line break into the <br /> code. If false, it does not do any line break conversions.

Re: Address ToString with pattern

Posted: Wed Sep 01, 2010 1:38 pm
by isaacdiaz74
Thanks Logan.