Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jan 03, 2018 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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 04, 2018 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.