Java:inserrer le string au millieu d'une phra
Résolu
Bonjour,
j'ai besoin vos aides
je veux inserrer un string au milieu d'une phrase, mais j'ai une erreur
lors de complilation veuillez m'aider svp
j'ai erreur suivante
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Syntax error on token "aString", ; expected
The method indexof(String) is undefined for the type StringManipulation
process cannot be resolved to a variable
at StringManipulation.main(StringManipulation.java:18)
la ligne 18 est le suivante
int pos aString indexof("language");
dans la ligne suivante le "prcocess " aussi souligné
str.insert(process,"oriented" );
j'ai besoin vos aides
je veux inserrer un string au milieu d'une phrase, mais j'ai une erreur
lors de complilation veuillez m'aider svp
for(int i=0;i<str.length();i++)
{
int p=i+1;
System.out.println("Character at position:"+p+"is"+str.charAt(i));
}
//inserting a string in the middle
String aString=new String(str.toString());
int pos aString indexof("language");
str.insert(process,"oriented" );
System.out.println("Modified String:"+str);
j'ai erreur suivante
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Syntax error on token "aString", ; expected
The method indexof(String) is undefined for the type StringManipulation
process cannot be resolved to a variable
at StringManipulation.main(StringManipulation.java:18)
la ligne 18 est le suivante
int pos aString indexof("language");
dans la ligne suivante le "prcocess " aussi souligné
str.insert(process,"oriented" );