English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i know i can use something like str1[0] etc to take each individual character in the string but how do i make it loop to accomadate an unknown iput a user might enter , for example if the input 47575 and i want to output them all separatle as 4 7 5 7 5 or if the user enters liek 839332 and i want to separate that, how do i make it adapt to different string lengths ?

2006-10-21 07:29:44 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

find the length of the string then run a loop.
Just an example to illustrate this:

for(i=0;i cout< or System.out.println(a[i]+' '); //java

Depending on what programming language u r using, you can find the length of the string.

2006-10-21 07:47:41 · answer #1 · answered by Manish 5 · 0 0

use the string lenght function to find the length of string u do not specify the name of language.

2006-10-21 07:58:51 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers