- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Golang Program to convert Uppercase to Lowercase characters, using binary operator.
In Golang, we can use the binary operators "&" (AND) and "|" (OR) to convert strings from lowercase to uppercase and vice versa. Let's take a simple example and understand how to use these binary operators in Golang.
Example
package main import "fmt" func main(){ fmt.Printf("Lowercase characters using OR operator: ") for ch:='A'; ch<='Z'; ch++ { fmt.Printf(string(ch | ' ')) } fmt.Println() fmt.Printf("Uppercase characters using AND operator: ") for ch:='a'; ch<='z'; ch++ { fmt.Printf(string(ch & '_')) } }
Output
On execution, it will produce the following output:
Lowercase characters using OR operator: abcdefghijklmnopqrstuvwxyz Uppercase characters using AND operator: ABCDEFGHIJKLMNOPQRSTUVWXYZ
- Related Articles
- Write a C program to convert uppercase to lowercase letters without using string convert function
- Java program to convert a string to lowercase and uppercase.
- Convert string to lowercase or uppercase in Arduino
- Convert all lowercase characters to uppercase whose ASCII value is co-prime with k in C++
- How to convert lowercase letters in string to uppercase in Python?
- Java program to find the percentage of uppercase, lowercase, digits and special characters in a String
- How to convert all uppercase letters in string to lowercase in Python?
- Golang Program to convert an integer into binary representation
- C Program for LowerCase to UpperCase and vice-versa
- How to convert the content of the file into uppercase or lowercase?
- Converting Odd and Even-indexed characters in a string to uppercase/lowercase in JavaScript?
- How to convert all the records in a MySQL table from uppercase to lowercase?
- Write a Golang program to convert a binary number to its decimal form
- Write a Golang program to convert a decimal number to its binary form
- Check if lowercase and uppercase characters are in same order in Python

Advertisements