Little UDF problem concerning substring

Hi, i need to do the following in UDF:
read a string ("00002000"), delete the first upcoming "0" and give it back
(the advance action should be, that the last three "0" should be taken and add a "." before it. Result will be "2.000")
the simple requirement i tried with this code:
          int position = 0;
          String target = "0";
          String newString;
          for (int i = 0; i < LFIMG.length(); i++) {
               int temp = LFIMG.charAt(i);
               if (LFIMG.valueOf(i) != target) {
                    position = i;
                    break;
          newString = LFIMG.substring(position);
but something is wrong here!
can u help? br

Hi Carsten,
can you please check your code once again... may be u r missing some wild characters.
Your code : a[0].replaceAll("0","");
Actual  code : <b>args[0].replaceAll("^0*","");</b>
if * is not working try putting + in place of that.
or use this code
public String remLeadZeros(String a,Container container){
String b = a.replaceFirst("^0+", "");
return b;
I have one more solution.. you just put a dot in your desired position and then use xslt to remove leading zero. but the above code shud work.
For example :
Use it ike this
<xsl:variable name="a">
<xsl:call-template name="removeLeadingZeros">
<xsl:with-param name="phone">
<xsl:value-of select="EVENT/ContactPhone"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:template name="removeLeadingZeros">
<xsl:param name="phone"/>
<xsl:message>
<xsl:value-of select="$phone"/>
</xsl:message>
<xsl:choose>
<xsl:when test="starts-with($phone,'0')">
<xsl:call-template name="removeLeadingZeros">
<xsl:with-param name="phone">
<xsl:value-of
select="substring-after($phone,'0' )"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$phone"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Hope this will help you
Regards
Aashish Sinha
PS : reward points if helpful

Similar Messages

  • Problem concerning an automatic renaming on desktop

    Hi,
    I have a problem concerning my desktop.
    Each time I copy a file on the desktop, it is instantly renammed.
    A little time ago, i used automator to rename serial and the last sequence i renamed was Fringe.
    Now each time i copy a file on the desktop it is renamed "Fringe" but the point is that i do not do anything to have it renamed....
    Any suggestion?
    Thanks a lot.

    I just found the solution by searching how to correct it!
    I just had to delete the automator workflow into ~/Library/Workflows/Applications/Folder Actions/
    Thank you very much for your help!

  • Hi, I have a Power Book G4 Tiger 10.4.11 and my problem concerns iTunes 9.2.1(5). I have changed my Apple ID and password recently. Since that, I am told when I try to buy something in iTunes Store that my "session has expired". Where does this come from?

    Hi, I have a Power Book G4 Tiger 10.4.11 and my problem concerns iTunes 9.2.1(5). I have changed my Apple ID and password recently. Since that, I am told, only when I try to buy something in iTunes Store, that my "session has expired". Where does this come from? What should I do to solve this problem ? I would greatly appreciate your help. Thank you in advance.

    Hi, I am khonthaï. I solved the problem thanks to JHdeVilliers's post on 4 Dec. 2011: I removed all cookies in Safari and it worked immediately !!!

  • Problem with substring in xsl file?

    Hallo,
    i have a xsl file, when using
    <xsl:value-of select="StsEdat"/> i've got 2007-05-21, that's o.k.
    when using <xsl:value-of select="substring(StsEdat,9,2)"/> the answer is blank.
    also 0,5 or so on. substring at this position delivers blank. why?
    what can it be? i'am helpless.
    any help is appreciated.

    Hi,
    I used <xsl:value-of select="substring(StartDate,9,2)"/> the answer was 21 and to 0,5 the answer was 2007. It seems that's ok!
    Try to do it and see if you have problem with substring.
    <xsl:variable name="StsEdat">2007-05-21</xsl:variable>
    <xsl:value-of select="substring($StsEdat,9,2)"/>
    or this weird way, :)
    <xsl:variable name="StsEdat">2007-05-21</xsl:variable>
    <xsl:value-of select='substring-after(substring-after($StsEdat, "-"), "-")' />
    Regards,
    Cleiton

  • Problems concerning Agilent 89410A programming

    Hey!
    I have a problem concerning Agilent 89410A signal analyzer programming.
    The timeout error (-1073807339) and bundle error (-1074003951) pop up during the "Initialize.vi" execution. The time out error exist in the VISA Read part of the VI.
    "The given session or object reference is invalid" error (-1073807346) pops up during "Application.vi" and "Close.vi" executions.
    Agilent´s "analyzer address" is set to 16" Should I set something else to specific value?
    What to do? I need a piece advice!
    (please, step by step)

    Hi,
    The -1073807346 error shows that you may be using the wrong resource descriptor.
    The first thing you need to do is determine if you are able to communicate with the instrument. Connec the instrument to the GPIB board and power on. In MAX, select "Scan for Instruments". If the instrument is detected (with the ID string) it means that the GPIB communication is working.
    Next, open a interactive VISA session. In MAX right-click on the instrument entry and select "Open VISA session". The interactive VISA control will open. Click on the Basic I/O and see if you can perform a Basic read nad write. The control uses the exact same functions used by the instrument driver. If it work, then you'll need to look at your VI.
    Use the instrument driver Ge
    tting Started VI and see if you can run it. Make sure you are using the right resource descriptor. The resource descriptor should be GPIB::. id is the number that shows up in MAX for the different GPIB interfaces (GPIB0, GPIB1, etc).
    Finally, if it doesn't work, troubleshoot the driver using LabVIEW's debugging facilities, such as highlight execution and NI Spy.
    NI-Spy toturial
    DiegoF
    National Instruments

  • Lync 2013 I have a strange problem concerning group call pickup in lync 2013.the pickup calls on snom 710 having only a second delay, but in lync client it having about 5-7 second Anybody out there having similar problems with call pickup Groups?

    HI
    I have a strange problem concerning  group call pickup  in lync 2013.the pickup calls on snom 710 having only a second delay, but in lync client it having  about 5-7 second
    Anybody out there having similar problems with call pickup Groups?

    Hi,
    Did you meet any other call delay when you using Lync?
    As the issue happen for Lync desktop client, it can be performance issue. Please check if there is any error message from FE Server when the issue happen.
    Also please check if you have updated Lync Server to the latest version, if not, update it and then test again.
    Best Regards,
    Eason Huang  
    Eason Huang
    TechNet Community Support

  • Little "big" problem with Reports 9i...

    Hi to all.
    I've a little "big" problem when i launching reports on the web. The reports services it's under SUN Solaris 5.9 and de 9iAS 9.0.2. Well when i launch the report the reports server give me this error: "REP-108: File '/tmp/pfj66590734.gif' not found.".
    The report have a chart, and the chart it's the problem, if i delete the graph(chart) the report run fine. In the Reports Server file config in the tmpDir, have specified this directory but, not find the gif.
    Can be a problem of the chart with the reports engine?
    I don't know.
    Anybody have which that's the problem.
    Thanx in advance. Oscar.

    I was facing the same problem when running a report with embedded chart graphics, and every time we tried running it we got an error message like the one below, where the gif file name changed every time:
    REP-108: File 'd:\ora9ias\reports\temp\pfj30143486.gif' not found
    Our solution was:
    After a lot of research and troubleshooting we found out that if we compiled the report in a different machine (the developers') and deployed to the server it worked fine, the problem was the settings (registry and path variables) in the machine that was compiling the report (Our software release machines). I can't say exactly what were the settings changes right now, but try under someone else's machine, its the configuration of reports builder.
    Hope this helps.

  • Problem concerning the -U flag

    There is a problem concerning the -U Fortran compiler flag in SS12. I use the -U flag in all my projects because, using that flag, capitalization matters (so that, e.g., the compiler treats "foo" and "Foo" as different variables). However, in some projects, although the compiler builds the project correctly, when I try to execute the resulting executable from within SS2, I get the following error message:
    make[2]: m2c: Command not found
    make[2]: *** [project name] Error 127
    make[2]: Leaving directory `[working directory]'
    *** Error code 2
    ..................Note that I can execute it directly (from a terminal window) without any problem. I just cannot execute it by pressing <F6> in SS2. The strange thing is that it does not happen to all my projects, although all of them are based on similar Makefiles. Note also that when I remove the -U flag and rebuild, all projects can be executed from within SS2.

    With my own Fortran Makefiles (on any platform), I use '.SUFFIXES:' rules to get rid of
    any built-in .mod rules for Modula. You have to put a blank .SUFFIXES to flush the
    built-in rules, then add your actual suffixes.In fact, a single blank .SUFFIXES solves the problem. Thank you very much for the hint.
    However, I still cannot understand why this .SUFFIXES blank line is necessary in some projects while it is not in other (similar) projects.
    By default Sun Studio IDE uses GNU make on Linux only. On Solaris
    it is using "dmake". Which platform do you use, Linux or Solaris?I use Linux (Debian 4 x64 version).

  • I have a problem concerning my icloud mail not my apple store mail...where i cannot access my icloud mail and i forgot my password

    I have a problem concerning my icloud mail not my apple store mail...where i cannot access my icloud mail and i forgot my password

    Hi, fungo47.  
    Thank you for visiting Apple Support Communities.
    You can reset your Apple ID/iCloud password via the steps in the first article below.  If you do not have access to the email account or are not receiving the password reset link, see the second article.
    If you forgot your Apple ID password
    http://support.apple.com/en-us/HT201487
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Cheers,
    Jason H.

  • Problem with SUBSTR

    En una view, al crear un campo con SUBSTR( campo, 1, 150), devuelve un campo con tamaño de 600, el correcto seria 150, cual es la causa ?

    Hi user 512674,
    Please, post your questions in English. Otherwise, only Spanish-speaking people can help you (or those who can guess what the problem is ;)
    SUBSTR(campo, 1, 150) means 150 characters. In an AL32UTF8 database, which you most probably have, this translates to 4*150=600 bytes. That is, the column must be able to store 600 bytes to be sure that it can store 150 AL32UTF8 character codes.
    View creation does not depend on the value of the session parameter NLS_LENGTH_SEMANTICS. The view columns inherit the semantics from the underlying table columns. If <campo> column is defined with character semantics the view column will be created with character semantics: ALL_TAB_COLUMNS.DATA_LENGTH will show 600 (bytes), ALL_TAB_COLUMNS.CHAR_LENGTH will show 150 (characters), ALL_TAB_COLUMNS.CHAR_USED will show 'C'. Otherwise, the view will be created with byte semantics: ALL_TAB_COLUMNS.DATA_LENGTH will show 600 (bytes), ALL_TAB_COLUMNS.CHAR_LENGTH will show 600 (characters), ALL_TAB_COLUMNS.CHAR_USED will show 'B'.
    -- Sergiusz

  • I have a little bit problem with verify my apple ID, I don't get any message for verification aplle ID from Apple. Why? Anyone can help me

    Dear all,
    I have a little bit problem with verify my apple ID, I don't get any message for verification aplle ID from Apple. Why? Anyone can help me

    Hi Tep Virak,
    Thanks for visiting Apple Support Communities.
    You may want to log into your Apple ID first to double-check that it's the right email address and re-send the verification email using these steps:
    Sign in to My Apple ID to manage your account information.
    Click Resend under Primary Email Address.
    From:
    Apple ID: Associating and verifying email addresses with your Apple ID
    http://support.apple.com/kb/he68
    All the best,
    Jeremy

  • Problem with SUBSTR and GROUP BY

    Hi people...
    I'm needing a little help with this case. I'm executing this SQL and got error ORA-01722. I've tried to use number columns, alias and the syntax below and always got error. My problem is the SUBSTR, without it I can run the SQL with no error.
    SQL> ED
    Gravou arquivo afiedt.buf
    1 SELECT TO_CHAR(DATA,'DD/MM') AS DATA,
    2 SUBSTR(TO_CHAR(DATA,'DAY'),1,3) AS DIA_SEM,
    3 SUM(DECODE(TIPOBAIXA,1,1,0)) AS INST,
    4 SUM(DECODE(TIPOBAIXA,1,0,1)) AS REM,
    5 SUM(DECODE(TIPOBAIXA,1,1,0))-SUM(DECODE(TIPOBAIXA,1,0,1)) AS DIFF
    6 FROM BAIXA
    7 GROUP BY TO_CHAR(DATA,'DD/MM'), TO_CHAR(DATA,'DAY')
    8* ORDER BY TO_CHAR(DATA,'DD/MM') DESC
    SQL> /
    GROUP BY TO_CHAR(DATA,'DD/MM'), TO_CHAR(DATA,'DAY')
    ERRO na linha 7:
    ORA-01722: invalid number
    Somebody has an idea of how I can solve this?
    Thanks,
    Fabiano

    SQL> create table baixa
      2  as
      3  select sysdate data, 1 tipobaixa from dual union all
      4  select sysdate - 1, 0 from dual union all
      5  select sysdate - 2, 1 from dual
      6  /
    Tabel is aangemaakt.
    SQL> SELECT TO_CHAR(DATA,'DD/MM') AS DATA
      2       , TO_CHAR(DATA,'DY') AS DIA_SEM
      3       , SUM(DECODE(TIPOBAIXA,1,1,0)) AS INST
      4       , SUM(DECODE(TIPOBAIXA,1,0,1)) AS REM
      5       , SUM(DECODE(TIPOBAIXA,1,1,0))-SUM(DECODE(TIPOBAIXA,1,0,1)) AS DIFF
      6    FROM BAIXA
      7   GROUP BY TO_CHAR(DATA,'DD/MM'), TO_CHAR(DATA,'DY')
      8   ORDER BY TO_CHAR(DATA,'DD/MM') DESC
      9  /
    GROUP BY TO_CHAR(DATA,'DD/MM'), TO_CHAR(DATA,'DY')
    FOUT in regel 7:
    .ORA-01722: invalid number
    SQL> select to_char(data,'dd/mm') as data
      2       , to_char(data,'DY') as dia_sem
      3       , sum(decode(tipobaixa,1,1,0)) as inst
      4       , sum(decode(tipobaixa,1,0,1)) as rem
      5       , sum(decode(tipobaixa,1,1,0))-sum(decode(tipobaixa,1,0,1)) as diff
      6    from baixa
      7   group by to_char(data,'dd/mm')
      8       , to_char(data,'DY')
      9   order by 1 desc
    10  /
    DATA  DI                                   INST                                    REM                           DIFF
    05/01 VR                                      1                                      0                              1
    04/01 DO                                      0                                      1                             -1
    03/01 WO                                      1                                      0                              1
    3 rijen zijn geselecteerd.Regards,
    Rob.

  • Same but a little different problem with iPod

    I installed my iPod shuffle and everything worked great. Then I tried to recharge it and now I have the same blinking light problem that everyone else has described. My difference is that my iPod is recognized in iTunes, but not recognized by Windows. My computer only shows it as a mass storage devise. When I try to restore the iPod, I get a "Firmware update failure. Disk write error" notice.
    Can someone please give me some direction??
    Thanks.
    Dell laptop   Windows XP  

    Don't be concerned that Windows doesn't recognize your Shuffle. I support two Shuffles with my computer, and when they're plugged-in (one at a time) they only show up under Control Panel/System/Device Manager/Disk Storage/Apple iPod USB Device -- they're not assigned a drive letter. Now, are you trying to charge your Shuffle with iTunes open? If so, try charging with iTunes closed, and the Shuffle turned OFF. The Status light may flash for 30 seconds or so but then it should go steady.
    Roger

  • Can anyone help me with a little display problem in IE7 please?....

    I have just uploaded a new site which has been created using Dreamweaver CS4 for Windows.  There is no problem viewing the site in IE 8, or in Firefox.
    The site is basically a gallery of images.  For some of the main images I've used little magnifying glass 'plus' symbols, which are simply linked rollover png images that take you to a larger version of the image.  In IE7 (and I presume in older versions too) these little symbols aren't displaying in the correct position on each of these pages, they've jumped and are incorrectly displaying over the top, left corner of the main image.
    Here's the link:
    www.sjcillustration.com
    Firstly, why is this happening in IE7 and yet all's fine in IE8 or in Firefox, and secondly, can anyone tell me how to fix it please?
    (I was going to attach the corresponding CSS file but don't see an attach file button.......)
    Cheers!

    Hi Cristian, thanks for responding so speedily!
    On the homepage, click on the 'diagrammatic' thumbnail for example, then click on the 'volcano' thumbnail, when the volcano page appears, you should see the little magnifying glass plus rollover image under the main image to the right.   As I said, on these specific pages, in IE 7 the symbol jumps to the top left of the main image.
    For your info, I have seen this problem on my older XP pc, which runs IE 7.  All is fine on my newer Vista pc, which is using IE8 & Firefox.
    Maj

  • Little WiFi problem/projecy

    Hi,
    I've got a little problem. I have to install a small network in my basement, but my cable modem is on the 2nd floor and i can't move nothing.
    On the 2nd floor, i have a WiFi router connected to the modem.
    Now i want to connect another WiFi router (maybe configured as a AP) to the WiFi router on the 2nd floor.
    Diagram :
    (modem) --cable-- (WiFi router 1) << wireless >> (WiFi Router 2) --cable-- (PC)
    Is this possible ?
    I have a DLink DIR-655 and Linksys WRT54GX2.

    No.  You must connect the two routers via an ethernet cable to do what you want.  However, 3rd party firmware can connect them wirelessly, but I don't not know if D-Link can do this.  Check for DD-WRT firmware to handle both routers.

Maybe you are looking for