+ 2

How can i convert a string in toggle case?

21st Aug 2019, 9:26 AM
Piyush Srivastava
Piyush Srivastava - avatar
3 Réponses
+ 3
Here's a method import java.util.*; String ToggleCase(String s, boolean b){ if (s.isEmpty()) return s; char c = s.charAt(0); if(b) c = Character.toUpperCase(c); else c = Character.toLowerCase(c); else return (c+ToggleCase(s.substring(1),!b)); }
21st Aug 2019, 7:01 PM
Stuart Moss
Stuart Moss - avatar
+ 1
جميل
22nd Aug 2019, 11:58 PM
جمال شاني
جمال شاني - avatar
0
hi
23rd Aug 2019, 2:06 AM
Kavitha Gopika
Kavitha Gopika - avatar