- #1
- 4,652
- 38
What does the "1" do in string() in this line?
answer = string(1,'0'+i%10) + answer;
Thanks!
answer = string(1,'0'+i%10) + answer;
Thanks!
A string() argument is a type of variable or data type in programming that represents a sequence of characters. It is often used to store and manipulate text-based data.
A string() argument can be used for a variety of purposes in programming, such as storing user input, displaying messages, and manipulating and comparing text-based data.
Yes, a string() argument can be used with other data types in programming. For example, it can be concatenated with a number to create a message with a numerical value.
Some common methods for manipulating a string() argument include concatenation, substring extraction, and searching for specific characters or patterns within the string.
Although strings are a useful and versatile data type, they do have some limitations. For example, strings can only represent a finite number of characters and may have difficulty representing non-ASCII characters or special symbols.