Replace "dash" values in a field with new line- VB equivalent of Python

Dave Angel davea at davea.name
Tue Mar 19 11:57:17 EDT 2013


On 03/19/2013 11:36 AM, Cathy James wrote:
> Dear All,
> I need some assistance with Python so that values in the "Name" field e.g.
> Murray - James - Leo can be labeled as:
>
> Murray
> James
> Leo
>
> with a new line replacing every dash.
>
> Basically I need the equivalent of this VB in Python:
> replace ( [Name]  , "-", vbNewLine)
>
> I tried this but no luck:
>
> str.[Name].replace("-", "\n")
> str.[Name].replace("-", \n)
> [Name].replace("-", \n")
>
> Your help is appreciated
>
>
>

Name = Name.replace("-", "\n")

-- 
DaveA



More information about the Python-list mailing list