6 Replies Latest reply on Jan 29, 2016 3:54 AM by nivin pauly

# Check upper case or not

Hi All,

How do I check if string has 4 letters and if it is upper i need that word

Example:

How are you DOIN today from

So I need "DOIN"

How can i acheieve this?

• ###### 1. Re: Check upper case or not

Venkatesh,

Find my approach below and stored in attached workbook version 9.0

a. Contains DOIN: CONTAINS([text],'DOIN')

b. DOIN: if [Contains DOIN]=true then 'DOIN' END

1 of 1 people found this helpful
• ###### 2. Re: Check upper case or not

Hi Shawn,

If I  use str length  it is taking length of entire string. I Need only then words which has 4 charecters from a entire string

• ###### 3. Re: Check upper case or not

Hi Norbert ,

My String is not always DOIN it varies every time , SO i need it dynamicaly and i Caanot use Strlen because it is length of entire string , I need it individually

• ###### 4. Re: Check upper case or not

it may not right approach,

we can try out by using the ASCII of forst letter of given string.

If

length([Names])= 4

and

(ascii(left([Names], 1) >= 65 and ascii(left([Names], 1)<=90)

then "First Letter Upper Case & Contains 4 Letters "

else "First Letter Lower case & Contains 4 Letters"

end

If you want to test for all letters of the string, then extend the above calculated field by adding the condtioin for 2nd, 3rd, 4th letters.

Best Regards

Kumar

1 of 1 people found this helpful
• ###### 5. Re: Check upper case or not

Haha!  Third times a charm, hopefully.

to match the rows - REGEXP_MATCH([YourString],'\b([A-Z]{4})\b')

to extract the 4 letters - REGEXP_EXTRACT([YourString],'\b([A-Z]{4})\b')

One thing to note is if you have two four letter upper words in a string it will just extract the first.

| Tableau Public - Example

• ###### 6. Re: Check upper case or not

unichar ch = [@"This is my String" characterAtIndex:0];
if (ch >= 'A' && ch <= 'Z') {
// upper case
}
else if (ch >= 'a' && ch <= 'z')
{
// lower case }

Note that this works only for English alphabet.

Java training in chennai

Android training in chennai

Oracle dba Training in Chennai