How to convert a string to sObjectType
Here is the way:
// I have Account name in String
String objectStr = 'Account';
// Convert to schema.sObjectType
Schema.SObjectType convertType = Schema.getGlobalDescribe().get(objectStr);
// Create an instance of that type
Sobject genericObject = convertType.newSObject();
// or if I know it is Account !! why making Sobject ?
Account acc = (Account)convertType.newSObject();
An alternate way to do this without going through Schema.getGlobalDescribe():
String myString = 'Account';
SObjectType sObjType = ((SObject) Type.forName(myString).newInstance())
.getSObjectType();
speed comparison between above and getXXDescribe methods