cancel
Showing results for 
Search instead for 
Did you mean: 

UDF to find out first character and replace with space

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

juan_vasquez2
Active Participant
0 Kudos

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);

Answers (1)

Answers (1)

Former Member
0 Kudos

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