This is a migrated thread and some comments may be shown as answers.

C# to Vb string concatenation errors

1 Answer 49 Views
Code Converter
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Peter
Top achievements
Rank 1
Peter asked on 12 May 2011, 06:36 AM
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"

1 Answer, 1 is accepted

Sort by
0
Todd
Telerik team
answered on 12 May 2011, 04:12 PM
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.

-Todd

Tags
Code Converter
Asked by
Peter
Top achievements
Rank 1
Answers by
Todd
Telerik team
Share this question
or