Skip to Content
0

UDF to find out first character and replace with space

Jan 03 at 12:18 PM

36

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Juan Vasquez Jan 03 at 02:23 PM
0

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);
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 04 at 04:35 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded