How to write a expression to display the first letter in Caps in each word using transformer stage ? Please let me know ASAP

Thanks in advance...



How to write a expression to display the first letter in Caps in each word using transformer stage ?..

Answer / Viddhotma

To convert the first letter of each word into uppercase using a transformer stage, you can use a regular expression (regex) with the `toUpperCase()` method. Here's an example using Java:

```java
String text = "hello world";
String regex = "(w)"; // matches a word boundary followed by any alphabetic character
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(text);
String result = matcher.replaceAll(m -> m.group().toUpperCase());
System.out.println(result); // prints: Hello World
```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Stage Interview Questions

create a job to get the previous row salary for the current row.if there is no previous row exists for the current row,then the previous row salary should be displayed as null? empid   salary   previoussalary 10      1000     null 20      2000     1000 30      3000     2000       40      4000     3000

5 Answers   Genpact,


How can you find out whether datastage process is running or not in unix?

3 Answers   Accenture,


how to change left and right links in join stage?

4 Answers   Cap Gemini, IBM,


What are the types of containers?

1 Answers  


what is executable in DataStage?

2 Answers  


What are iconv and oconv?

1 Answers  


I have file with empid,empname and I want to load these two fields along with sal in my target 1)salary must be same for all the records 2)I want pass the salary at run time

7 Answers   TCS,


How we can covert server job to a parallel job?

1 Answers  


How to clean the datastage repository?

1 Answers  


souce file having the columns like name company krish IBM pooja TCS nandini WIPRO krish IBM pooja TCS if first row will be repeat i want the result like this name company count krish IBM 1 pooja TCS 1 nandini WIPRO 1 krish IBM 2 pooja TCS 2

9 Answers  


what r the stages mostly used in realtime scenarios

4 Answers   HCL, IBM,


What are the types of containers in datastage?

1 Answers  


Categories