-
Python:
# Using the capitalize() method string = "bootrstap to capitilize leeter" capitalized_string = string.capitalize() print(capitalized_string) -
Java:
// Using the toUpperCase() method String string = "bootrstap to capitilize leeter"; String capitalizedString = string.toUpperCase(); System.out.println(capitalizedString); -
JavaScript:
// Using the toUpperCase() method let string = "bootrstap to capitilize leeter"; let capitalizedString = string.toUpperCase(); console.log(capitalizedString); -
C++:
#include <iostream> #include <algorithm> #include <string> using namespace std; // Using the transform() function from the algorithm library int main() { string str = "bootrstap to capitilize leeter"; transform(str.begin(), str.end(), str.begin(), ::toupper); cout << str << endl; return 0; }
Это всего лишь несколько примеров. Существует множество других языков программирования и методов, которые можно использовать для написания заглавных букв в строке.