我正在通过JSON提取twitter用户的个人资料图片.为此,我的代码是:
$x->profile_image_url
Run Code Online (Sandbox Code Playgroud)
返回配置文件图像的URL.URL的格式可以是"..xyz_normal.jpg"
或"..xyz_normal.png"
或"..xyz_normal.jpeg"
或"..xyz_normal.gif"
等
现在我想从我收到的每个网址中删除"_normal"部分.我怎么能在PHP中实现这一点?我已经厌倦了尝试.请帮忙.
我正在尝试将一个非常大的输入读取为String,然后将其转换long
为如下所示:[该程序适用于短输入]
输入是两个int
用空格分隔的,例如:"1248614876148768372675689568324619856329856295619253291561358926935829358293587932857923857934572895729511 413241"
我的代码:
import java.io.*;
import java.math.*;
import java.util.*;
public class Solution {
public static void main(String args[] ) throws Exception {
Solution obj = new Solution();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
String input[]=new String[T];
for (int i=0;i<T;i++) {
input[i] = br.readLine();
}
for (int i=0;i<T;i++){
StringTokenizer st = new StringTokenizer(input[i]," ");
BigInteger N = new BigInteger(st.nextToken());
BigInteger P = new BigInteger(st.nextToken());
System.out.println(obj.result(N,P));
}
}
}
public BigInteger result(BigInteger …
Run Code Online (Sandbox Code Playgroud)