C# to Vb string concatenation errors

2 posts, 0 answers
  1. Peter
    Peter avatar
    1 posts
    Member since:
    May 2011

    Posted 12 May 2011 Link to this post

    This was reported back in 2008 and still doesn't work as of May 2011
    Strings are concatenated with an Apersan(&) in VB & not a Plus sign (+)
    Converting VB to C#, the Apersan is converted to a plus sign,
    Converting C# to Vb, the plus sign is NOT converted to an Apersan,

    Some simple logic could perform this automatically

    c# (Examples)
    A = "StringText" + "SomeText";
    B = A + "SomeText";
    B = "SomeText" + A;
    A += "To Text";

    VB (Converted - all of these can/will fail in VB, especialiy if text contains numbers)
    A = "StringText" + "SomeText" 
    B = A + "SomeText"  
    B = "SomeText" + A  
    A += "To Text"

    VB (What's actually required by the converter)
    A = "StringText" & "SomeText"
    B = A & "SomeText"
    B = "SomeText" & A
    A &= "To Text"
  2. Todd
    Todd avatar
    66 posts

    Posted 12 May 2011 Link to this post

    Hello Peter,

    Sorry for the continued conversion trouble with this scenario. As you may have noticed in other forum threads, this Converter depends on the open source NRefactory engine to do its conversions between languages. In general, we try to support any conversion features natively supported by NRefactory. It seems that the conversion engine does not yet well handle these cross-language string concats.

    We'll do some research and see if a newer version of NRefactory now solves the issue. In the meantime, we suggest that you share feedback on the engine's conversion accuracy with the NRecfactory development community.

    Hope that helps. Thanks for highlighting this conversion scenario.


Back to Top