问题:从字符串中提取出一个指定的.由分割符隔开的子字符串.create view v as select 'mo,larry,curly' as namefrom t1union allselect 'tina,gina,jaunita,regina,leena' as name from t1; select * from v;+--------------------------------+| name |+---------------…
题目: Write a function to find the longest common prefix string amongst an array of strings. 思路:求最长前缀子串,假设第一个字符串是最长前缀子串,采用增强for得到数组中每个字符串,分别与第一个字符串的同一位置进行比较,有一个字符串在该位置不一致,就返回. public class Solution { public String longestCommonPrefix(String[] strs) { i…