Skip to content

Instantly share code, notes, and snippets.

View raanaYavari's full-sized avatar

Raana Yavari raanaYavari

  • Trivago
  • Düsseldorf, Germany
View GitHub Profile
@raanaYavari
raanaYavari / PersianCalendar.java
Last active August 21, 2022 06:14
Persian Date Converter
package com.kasra.picker.utils;
import java.util.GregorianCalendar;
import java.util.TimeZone;
public class PersianCalendar extends GregorianCalendar {
private static final long serialVersionUID = 5541422440580682494L;
private int persianYear;
private int persianMonth;
fun findPartners(key: String, arr: Array<String>): Unit {
var name = key.substring(0, key.lastIndexOf('_'))
val regex = Regex(name + "_[0-9]+")
arr.forEach { s ->
if (regex.containsMatchIn(s)) {
println(s)
}
}
}