substr函数 substr函数返回从字符串指定位置开始的一个子串。如果指定了子串的长度,则返回字符串的相应部分。如果指定的长度超出了字符串的实际范围,则返回其实际内容。
格式
substr(字符串,起始位置)
substr(字符串,起始位置,子串长度)
范例
$ awk '{print substr("Santa Claus",7,6)}' filename...
分类:
其他好文 时间:
2015-05-11 21:58:14
阅读次数:
121
-Dmaven.multiModuleProjectDirectory system propery is not set.Check $M2_HOME environment variable and mvn script match.可以设一个环境变量M2_HOME指向你的maven安装目录M2...
分类:
系统相关 时间:
2015-05-11 21:29:56
阅读次数:
120
<LinearLayout?xmlns:android="http://schemas.android.com/apk/res/android"
????xmlns:tools="http://schemas.android.com/tools"
????android:layout_width="match_parent"
????android:layout_...
分类:
其他好文 时间:
2015-05-11 11:06:44
阅读次数:
332
Description
A TV-network plans to broadcast an important football match. Their network of transmitters and users can be represented as a tree. The root of the tree is a transmitter that emits the foot...
分类:
其他好文 时间:
2015-05-11 09:03:33
阅读次数:
133
一个int占多少个字节?这个问题我们往往得到的答案是4.可是int究竟占多少个字节,却跟你的机器环境有关.As you can see, the typical data type sizes match the ILP32LL model, which is what most compilers...
分类:
其他好文 时间:
2015-05-09 21:52:55
阅读次数:
133
// poj2955 简单区间dp
// d[i][j]表示i到j区间所能形成的最大匹配序列
// dp[i][j] = max(dp[i][k]+dp[k+1][j]){i<k<j}
// dp[i][j] = max(dp[i+1][j-1]+2) if (s[i] match s[j])
//
// 记忆化搜索的时候,将dp[i][i] = 0 ,其他赋值成-1;
//
// 做题的时候刚开...
分类:
其他好文 时间:
2015-05-09 19:08:13
阅读次数:
118
function is_weixin(){ var ua = navigator.userAgent.toLowerCase(); if(ua.match(/MicroMessenger/i)=="micromessenger"){ return true; }else{ retur...
分类:
微信 时间:
2015-05-09 17:30:15
阅读次数:
223
在安卓的数据列表显示的时候,通常会用到ListView,所以列出下学习时候遇到的
1,用系统自定义的ListView
首先在xml文件中建立listview
<ListView
android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_h...
分类:
移动开发 时间:
2015-05-09 16:35:51
阅读次数:
169
Conditional Split 用于将数据流按照条件进行拆分,每一个output 都有name和condition。数据流逐行按照condition进行match,如果match,那么改行会进入相应的output。如果数据行跟所有的condition都不match,那么改行会进入defaulto...
分类:
其他好文 时间:
2015-05-09 14:55:34
阅读次数:
110
括号配对问题:
假设一个表达式中包含三种类型的括号:(),{ },【】,嵌套顺序任意
{ 【()()】 }
1 2 3 4 5 6 7 8
引入“期待的急迫程度”概念,例如当接受第一个括号 { ,则它期待与第8个 } 匹配,然而当接受到第二个 【 时,此时【最期待和第七个 】 匹配。
#ifndef _MATCH_H_
#define _MATCH_H_
#in...
分类:
其他好文 时间:
2015-05-09 13:29:50
阅读次数:
103