![]() |
#1 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Dec 2016
Posts: 799
Reputation: 25
|
![]()
Bom, eu estou estudando mais profundamente as strings.
E tenho essa dúvida: Bom, eu criei uma variável com 23 caracteres. Sendo essa variável: PHP Code:
PHP Code:
Code:
912|8239|2830|820301|8, 12|8239|2830|820301|8, 2|8239|2830|820301|8 Code:
9, 1, 2 |
![]() |
![]() |
![]() |
#2 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Mar 2018
Posts: 508
Reputation: 16
|
![]()
printf("%s, %s, %s", var_original{0}, var_original{1}, var_original{2});
Creio eu, que se você quiser usar com colchetes vai ter de criar a variável com aspas simples, dessa forma: new var_original[23] = '912|8239|2830|820301|8'; Não tenho certeza, nunca fiz dessa forma. |
![]() |
![]() |
![]() |
#3 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Dec 2016
Posts: 799
Reputation: 25
|
![]()
Não foi :/ alguém?
|
![]() |
![]() |
![]() |
#4 |
Huge Clucker
![]() ![]() ![]() Join Date: Mar 2016
Location: Paraná
Posts: 396
Reputation: 18
|
![]()
"%c"
|
![]() |
![]() |
![]() |
#5 |
Huge Clucker
![]() ![]() ![]() Join Date: Jun 2018
Posts: 356
Reputation: 14
|
![]()
Pois usando %s e definindo um número na variável da string ela irá sempre, nesse caso, printar os caracteres a partir do número que você colocou, se você colocar printf("%s", string[10]); ela irá começar a printar a partir da caractere "10", ignorando os caracteres anteriores.
|
![]() |
![]() |
![]() |
#6 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Dec 2016
Posts: 799
Reputation: 25
|
![]()
Muito obrigado à todos.
Consegui fazer o sistema manipulando os caracteres "ASCII" + REP à todos. |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
error 037: invalid string (possibly non-terminated string) | AnoTek | Scripting Help | 4 | 13/03/2017 02:08 PM |
input line too long (after substitutions) invalid string (possibly non-terminated string) | StackedPizza | Scripting Help | 4 | 09/11/2016 03:34 AM |
error 037: invalid string (possibly non-terminated string) | ridhoswasta | Scripting Help | 2 | 19/06/2014 04:34 PM |
string too small. but i dont wanna make the string like 9999.. | niels44 | Scripting Help | 2 | 23/10/2012 06:36 PM |
input line too long (after substitutions) - invalid string (possibly non-terminated string) | MahmutBey | Help Archive | 6 | 10/03/2011 02:39 PM |