2018 up to now | 2017 | 2016 | 2015 | 2014 | 2013 | 2012 | 2011 | 2010 | 2009 | 2008 | 2007

(older archive entries before 2007 are not shown here, but included in the onsite-search)

Mailing List - Entries of 2007


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

Re: [QF-Test] Replace a backslash by two backslashes


  • Subject: Re: [QF-Test] Replace a backslash by two backslashes
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: 15 Aug 2007 18:48:50 +0200

Hi René,

that's trivial: You need to escape the backslash for Jython as well,
so use

name = name.replace('\\','\\\\')

Best regards,
    Greg

René Hegeman <Rene.Hegeman@?.nl> writes:

>    Hi all,
>
>
>
>    I am trying to replace a backslash by two backslashes with this script:
>
>
>
>    name = rc.lookup("i_path")
>    name = name.replace('\','\\')
>    rc.setLocal("i_path", name)
>
>
>
>    i_path can be [1]\\server\folder\file.txt and need to be transferred
>    into \\\\server\\folder\\file.txt
>
>
>
>    However, this scripts gives an error message:
>
>    SyntaxError: Lexical error at line 4, column 27. Encountered: "\\"
>    (92), after : "\\"
>
>
>
>    Does anyone knows how to replace the backslash by two backslashes?
>
>
>
>    Greetings,
>
>
>
>    René Hegeman
>
>    Planon
>
> Verweise
>
>    1. file://\\server\folder\file.txt/
> _______________________________________________
> qftest-list mailing list
> qftest-list@?.de
> http://www.qfs.de/mailman/listinfo/qftest-list

--
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876
GF: Gregor Schmid, Karlheinz Kellerer          HRB München 140833