Skip to Content
avatar image
Former Member

UDF to find out first character and replace with space

Hi Experts,

i have below requirement pls help me to create UDF

If the 1st character is 0 then replace the same with space. old exterior colour code that is associated with the original order. Note that if the first character of the code is '0', first character will be change to space.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 03 at 02:23 PM

    Hello Chiranjeevi

    Is this that you need?

    the output for the sample is: ***test 1234230012

    String str1="01234230012";
    if (str1.substring(0,1).equals("0"))
       str1=" "+str1.substring(1);
    System.out.println("***test"+str1);
    
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 04 at 04:35 AM

    Hi Juan,

    Thanks for the reply..

    my requirement is If the 1st character is 0 then replace the same with space..

    for example :input 01D0

    I am expecting output as"space1D0"

    only i need to first chracter if it 0 replace with zero else need to pass complete vale for ex : input 1234

    output1234

    Add comment
    10|10000 characters needed characters exceeded