Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to convert lowercase letters to uppercase and uppercase letters to lowercase in a string. (ex, AbcdEfG should convert as aBCDeFg)

Answers were Sorted based on User's Feedback



How to convert lowercase letters to uppercase and uppercase letters to lowercase in a string. (ex, A..

Answer / agrawal_vivek

easiest way is to use the condition-

for(i=0;s[i]!='';i++)
{
if(s[i]>=65 && s[i]<=90) //Caps ASCII-65-90(60+32=97-----90+32=122)
s[i]=s[i]+32;

if(s[i]>=97 && s[i]<=122) // Small ASCII-97-122(97-32=65-----122-32=90)
s[i]=s[i]-32;
}

Is This Answer Correct ?    3 Yes 1 No

How to convert lowercase letters to uppercase and uppercase letters to lowercase in a string. (ex, A..

Answer / kunal

SELECT listagg(newstr) within GROUP (
ORDER BY rm)
FROM
(SELECT
CASE
WHEN SUBSTR('AbcdEfG',level,1)=upper(SUBSTR('AbcdEfG',level,1))
THEN lower(SUBSTR('AbcdEfG',level,1))
ELSE upper(SUBSTR('AbcdEfG',level,1))
END newstr,
rownum rm
FROM dual
CONNECT BY level <=LENGTH('AbcdEfG')
)

Is This Answer Correct ?    2 Yes 0 No

How to convert lowercase letters to uppercase and uppercase letters to lowercase in a string. (ex, A..

Answer / debashis mohanty

Select 'AbcdEfG',LOWER(SUBSTR('AbcdEfG',1,1))||UPPER(SUBSTR('AbcdEfG',2,3))||LOWER(SUBSTR('AbcdEfG',5,1))||UPPER(SUBSTR('AbcdEfG',6,1))||LOWER(SUBSTR('AbcdEfG',7,1)) From Dual

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

How to assign sql query results to pl sql variables?

0 Answers  


What is difference between db2 and sql?

0 Answers  


What is user define exception and example

1 Answers   HP, KP,


what is 'trigger' in sql? : Sql dba

0 Answers  


what is single byte over head in oracle..?

0 Answers  


What is pl/sql table? Why is it used?

0 Answers  


select sal from emp group by sal

3 Answers   TCS,


display your age in months?

2 Answers  


Explain the the delete statements in sql?

0 Answers  


i need department wise top 2 employees salary.which logic i will use

17 Answers  


How to run sql statements with oracle sql developer?

0 Answers  


What is normalization in sql?

0 Answers  


Categories