Item5471: The character 0 cannot be replaced using the replace-funtion of the SpreadSheetPlugin

Priority: Normal
Current State: Closed
Released In: 1.0.5
Target Release: patch
Applies To: Extension
Component: SpreadSheetPlugin
Reported By: TWiki:Main.SebastianKlus
Waiting For:
Last Change By: KennethLavrsen

Replace Function does not work properly in SpreadSheetPlugin

Trying to replace the character 0 within a text string, using the replace funtion of the SpreadSheetPlugin does not work.

For example:

 %CALC{"$REPLACE(Sebastian, 2, 1, .)"}% 

results in:

So this works fine.

2nd example:

 %CALC{"$REPLACE(11xxx, 2, 1, .)"}% 

results in:

So this works fine, too.


 %CALC{"$REPLACE(10xxx, 2, 1, .)"}% 

results in:

So here it does not work.

-- TWiki:Main/SebastianKlus - 24 Mar 2008

Sebastian is right. The 0 doesn't get replaced if the num parameter is 1. Strange effect. I don't understand why the substr( ) code in SpreadSheetPlugin/ does even work. Peter will know.

-- TWiki:Main.FranzJosefGigler - 25 Mar 2008

Found the support topic TWiki:Support.UnableToForceLinkNameTo0 which shows similar effect in totally different context. 0 seems to be somehow problematic.

-- TWiki:Main.FranzJosefGigler - 14 Apr 2008

Bug confirmed, needs to be fixed. $FIND, $SEARCH and $SUBSTITUTE seem to have the same bug.

-- TWiki:Main.PeterThoeny - 16 Apr 2008

Both REPLACE, FIND, SEARCH and SUBSTITUTE should be more robust now. I also added additional test cases in TestCases web for these.

-- KennethLavrsen - 22 Apr 2009
Topic revision: r12 - 25 Apr 2009, KennethLavrsen - This page was cached on 16 Sep 2021 - 16:09.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy