string str="gdjiofsfdsds[.rwgvosdfooeorw"; int index = str.IndexOf(".");//查找"."的下标,找到返回正确的位置下标,未找到返回-1