function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KhalfeKhalfe 

error code Line: 1, Column: 16 Unexpected token '('

I have this error when I try to execute this code Line: 1, Column: 16 Unexpected token '('.
I checked all the parentheses all of the in the code is correct.
 
public class MyId {   
    
	
    public static void show(){ 
        String url='https://drive.google.com/...../';
        system.debug(getId(url)); 
        }
    
    public static String getId(String gdriveUrl){
        String Id = gdriveUrl.remove('https://drive.google.com/.....');
        return Id;
	}

    
 }

 
Biswojeet Ray 11Biswojeet Ray 11

Hi Khalfe,

 

I have checked. The class is correct.

public class MyId {   
    
	
    public static void show(){ 
        String url='https://drive.google.com/...../';
        system.debug(getId(url)); 
        }
    
    public static String getId(String gdriveUrl){
        String Id = gdriveUrl.remove('https://drive.google.com/.....');
        return Id;
	}

    
 }

To execute "show" method.

Please use -> MyId.show();

 

Kindly let me know if it helps you and please mark as Best Answer.

Thanks,

KhalfeKhalfe
Thank you Ray, 
It's the same error I dont know why
Line: 1, Column: 13
Unexpected token '('.
I have second question this SOQL request
SELECT Id, Folder.Name FROM Folder
I want to integrate it a apex class,
public class SelectF{	
  public static void listFolder(){
        system.debug([SELECT Id, Folder.Name FROM Folder]);        
    }
}
but I have the same error 
Line: 1, Column: 19
Unexpected token '('.

Thanks in advance
Biswojeet Ray 11Biswojeet Ray 11

Hello,

 

Soql Will be 

[SELECT Id, FolderId, Folder.Name FROM Document ]

 

Thanks

KhalfeKhalfe
Thanks